When a Button having Content / Text 'ClickMe' is clicked, 'ClickMe' text is automatically arranged to foreground of the button.
But when user clicks the button having image on its background, background image becomes invisible & the foreground of button looks fully white.
Can we see the image on foreground instead of white color.
Is there any chance to change the foreground effect of the button when user clicks on button?
My Code "Button Height="128" HorizontalAlignment="Left" Margin="307,138,0,0" Name="button2" VerticalAlignment="Top" Width="150" BorderThickness="1">
"Button.Background>
ImageBrush ImageSource="/WinApp;component/Icons/camerabtn.png" />
/Button.Background>
/Button>"
Thanks in advance to all.
To do this you need to change the style of the button.
Easiest way to do that is in Expression Blend.
See this answer:
Windows Phone 7 (WP7) Change a button's background color on click
As Mick suggests, it would help to see some code for what you're trying to do, however, it sounds like you may have a change in a value (such as margin) in the Normal and Pressed states of the button resulting in the behavior you are seeing.
Related
I've created 2 buttons:
<Button title="TEST"></Button>
<Button title="TEST" backgroundColor="red"></Button>
The first is a really simple default button. And the second I just added a red background color. The result is this:
As you can see from the picture, just adding a different background color changes the button a lot from it's "native" appearance. What I would expect is that the button will remain the same, just with a red background.
The "styled" button is bigger (and as you can see I did not set up any dimensions).
The "styled" button corners are no longer round.
Most bothering - the "styled" button no longer has the android button ripple effect upon clicking.
Why is that? Can it be fixed?
The native button (AppCompatButton) is a bit more complex and is not using the backgroundColor to show the actual color. I think it is using a 9-patch in the background so if you set a backgroundColor it will remove that and you end up with the box and the color.
Try using the tintColor to change the background color or you can fake it using:
borderRadius
elevation
touchFeedback
touchFeedbackColor
Hi Im new to Xcode7 and Swift2 and I am trying to change the color of the buttons I am adding to my storyboard. Is there a way to change the color of the button in Xcode7? All I see are options to change color of text and add background image to a button but no change button color.
A button has many parts / aspects, so what do you mean by the "button color"? You probably mean the button's background color. If you scroll down in the button's attributes inspector, you'll come to the background color. The reason it's so far down is that it's a View (UIView) property, not merely a button (UIButton) property.
When I set a background to a button it does not cover the entire button. There is some offset or padding with background and button. How do I make the background cover entire Button?
<Button.Background >
<ImageBrush x:Name="LoginImg" source="fv.img" ></ImageBrush>
</Button.Background>
You should get into button's style.
Or, probably, the easiest way (just workaround) is to use negative padding.
After created an image with Tap gesture, when "tap" on the image, it does fire up the "GestureListener_Tap". However, the user experience is bad since when user tap on the image, the image won't "indent down" or look like pressing down...
Anyone know how to do that please?
<Image Source="images/Forex 1 Icons_62.png" Stretch="None" Margin="0,500,0,0">
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Tap="GestureListener_Tap" />
</toolkit:GestureService.GestureListener>
</Image>
I'm just guessing newer used an Image as a Button, most of the time i wrapped the image inside a button and then you get the Effects because it is a button. Maybe you would have to add the to the Image an Effect for example the toolkit:TiltEffect.IsTiltEnabled or you need to do it the hard way and create New States for the Image and change the state if the user Taps the image manually.
How can I create an action so when a button is clicked the Apple color palette window appears? I do not want to use an NSColorWell.
Thanks!
Do you mean the color panel? There's a method orderFrontColorPanel in the Application place holder in IB -- just connect that to your button.