How to set ImageView to chang color of foreground when click? - android-imageview

I want to call image from server and I use image in background of imageview when I click on button it will change foreground color of imageview to black (still show image but darker)
How to do this ?

try this code:
image.setColorFilter(Color.rgb(123,73,122), android.graphics.PorterDuff.Mode.MULTIPLY );
Found this from http://suryaandriodapps.blogspot.com/2011/12/apply-color-to-imageview-png-file.html?zx=e251678f0452e874 and worked for me..

Related

How to change background-color of LayoutAnimation?

I have a view which can be disappeared by clicking a button. Before I "remove" the View I set this:
LayoutAnimation.easeInEaseOut();
The animation works fine, but the Animation is always fading to white before reducing the height to zero. But the background of the app is black/darkblue.
Is there a way to change the color of this animation?

Transparent NSButton shown with unwanted backgroundColor

So I have an NSView in which I created some borderless buttons programmatically.
Although I set their backgroundColor property to desired color, they show up like they have a darker shade.
I guess that is the background of Label, not of Button, which does not appear when users choose to reduce transparency in System Preferences.
In that case, I have solved by this line of code:
myButton.appearance = NSAppearance(named: .aqua)
here How I would do it as I mentioned in comment.
The custom view is connected as iboutlet and given green color.
Label has by default no back ground color.
The button has no border and of type Round Rect as you see in screen shot.
The blue color around button is the selection/ active control, but you can get rid of that too.
self.testBtn.focusRingType = NSFocusRingTypeNone;
edit add new image showing scroll bar:
//set background color
button.backgroundColor=[UIColor clearColor]
//then set tint color of button
[btn setTintColor:[UIColor clearColor]];

set both backIndicatorImage and backIndicatorTransitionMaskImage on backbarbutton in IOS7 didnot show particular image

I searched all the topics about backbarbutton custom, but seems failed to find answers about my problem on backbarbutton.
To keep the property called interactivePopGestureRecognizer of UINavigationController, using leftBarButton to replace backBarButton is not a valid solution. But I want to custom the backbarbutton with a image, so I use the following code in my controller ViewDidLoad:
UIBarButtonItem * btnBack = [[UIBarButtonItem alloc]init];
btnBack.title = #"";
self.navigationController.navigationBar.backIndicatorImage = [UIImage imageNamed:#"backBtn"];
self.navigationController.navigationBar.backIndicatorTransitionMaskImage = [UIImage imageNamed:#"backBtn"];
self.navigationItem.backBarButtonItem = btnBack;
when I run my project, it shows just a blue rectangle in the place where backBarButton always show.
But the original image just like the system barbutton that called reply.
However, it has a different effect, just change to the image named "Drinks" which is a black image that show a glass of juice.
after run my project the place where always show backBarButton show a blue image just like "Drinks".
what happend! How can I custom my backBarButton with the giving image named backBtn.png, is there anyone can help me? Thanks in advance! For image submit has been reject, I discrible my problem in words.
The Image has be transparent where there should be nothing to be drawn. It should be opaque where the content of the image will be drawn. At least that worked for me. The final color will be tinted by the navigationbar's tintColor anyway.

How can an iOS7-style "Now Playing" button be added to an UINavigationBar?

I'd like to add an iOS7 Music app style "Now Playing" button to the UINavigationBar
The button should have:
two lines of text
a right pointing chevron
How can this be achieved?
You will probably need the image for the chevron. If that's okay for you then you can create a UIButton with proper title and image insets and pass to initWithCustomView: method.
Note: you will also need to set numberOfLines = 2 for this button which as far as I know you can not do in IB

Objective C - UIImagePickerController customize bottom navigation

How can I customize the button and background color of UIImagePickerController's bottom navigation?
In the image below, it would be the "cancel" & "choose" button and the background.
Thank you,
Tee
I doubt you can do any customizations to default controls. You can have complete customized view (preview view) if you set showsCameraControls to NO.