-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
iOS UIButton backgroundColor does not respond to color changes #9523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Currently Button on iOS doesn't respond to background color changes after it is created. This commit implements the backgroundColorProperty to access the native UIButton's backgroundColor property. Fixes NativeScript#9523
@rob4226 thank you, possible to post a PR of the change? Looks like just a reference to a fork at moment. If post as a PR we can merge out to the next tag and it will be included in the 8.1 release soon. |
@NathanWalker Yes, I was just running some more tests on it, but it looks good. It's PR #9524. Also, I created a new branch using @nativescript/core@7.3.0 and made the necessary changes to fix v7 (new branch in fork based on 7.3.0). I have a couple projects still stuck on 7 so would it be possible to also release a v7.3.1 with this fix? If you already have a branch for v7 fixes please let me know and I will base the commit on that instead of a new branch. I couldn't find a tag for v7.3.0 but I went through the changelog and commits and found it to be 7847c2f Thanks. |
Currently Button on iOS doesn't respond to background color changes after it is created. This commit implements the backgroundColorProperty to access the native UIButton's backgroundColor property. Fixes NativeScript#9523
Sure thing we could do that, much appreciated 🤗 |
I have found that after a Button is created on iOS, it is not possible to change the backgroundColor of it. It doesn't change if you change the CSS class nor does accessing the background color like
btn.backgroundColor = new Color('blue')
The below only works on Android, where as on iOS the button background color does not change after it is first set:I have had tons of issues on iOS when changing between dark and light themes while the app is running especially with buttons not responding to color changes and I think this might be the culprit. It appears that the backgroundColor property is not implemented on the iOS Button view.
I have made a PR to fix this in @nativescript/core.
The text was updated successfully, but these errors were encountered: