cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MayaD
Level: Power Up

Changing button fill when pressed on iPad

I am having troubles with a button that I can't get to change color/fill when pressed on iPad. It works well when I preview the app in browser while using mouse but wont happen on iPad. Any ideas what I could do to make it work?

 

Thanks in advance.

4 REPLIES 4
Super User
Super User

Re: Changing button fill when pressed on iPad

Use variables to do it

 

Screen - OnVisible=UpdateContext({Button1:true, Button2:false})

 

Then on Button 1

 * OnSelect =UpdateContext({Button1:true, Button2:false})

* DisplayMode = If(Button1,Disabled,Edit)

 

On Button 2

* OnSelect = UpdateContext({Button1:false, Button2:true})

* DisplayMode = If(Button2,Disabled,Edit)

 

You can set the Disabled Fill and Color for each of the buttons to whatever you want and you can do this with as many  buttons you want, I just did this example for two.

Highlighted
MayaD
Level: Power Up

Re: Changing button fill when pressed on iPad

Thanks for your response, I'll try it.

Community Support Team
Community Support Team

Re: Changing button fill when pressed on iPad

Hi @MayaD,

How do you change the Fill color of the Button within your app?

Have you solved your problem?

I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the Button control to following:

Set(IsClicked,!IsClicked)

Set the Fill property of the Button control to following:

If(IsClicked,RGBA( 255, 20, 147, 1 ),RGBA(56, 96, 178, 1))

Please take a try with above solution, check if your issue is solved.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Changing button fill when pressed on iPad

That is one option but it (in my opinion) works better the way I put above where instead having to put the if statement on your fill you just change the button properties off the variable. 

 

I have done both and just find this way to be easier and cleaner...but everybody has their own style and way of doing things. I like this option because I prefer being able to click on the colors so I can see what I like better instead of having to type them out in the if statement. But is basically has the same outcome either way. 

 

Rebecca  🙂 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,220)