I want a button's text color to be the same on both iOS and Android. So I thought I'd just set the TextColor property in code to the color I wanted. On iOS, the disabled text color is still grey (which is what I want), however, on Android, the disabled text color is the same as the enabled text color. How do I make the disabled text color on Android grey (or whatever its default is for a disabled button)? Thanks
相关问题
- How to implement only emoji keyboard for Entry?
- Error:Xamarin.Forms targets have been imported mul
- change button color on-click and remains same for
- HttpClient not accepting Authorization headers (40
- React Native onStartShouldSetResponder and onRespo
相关文章
- Xamarin form MessagingCenter Unsubscribe is not wo
- How to change the Back Button Text on Xamarin.Form
- Android add image to button
- How to close form
- Create a button with an image in Flutter?
- Android Button needs two click for action
- jquery toggle with buttons two images?
- Get control's dimensions in CustomRenderer (Xa
If above does not work for you, you could try to check this workaround. It uses a custom renderer and
NSAttributedString
for setting the title in disabled stateThat is the default behavior in Xamarin.Forms. To work around that and achieve a custom color, you can:
Because triggers are the most straightforward and consistent way of achieving what you want, I'll only cover that. You can see the xamarin docs for more information about custom renderers.
Using triggers, you can dynamically change the font color to gray when it is not enabled. See the docs for more information about triggers.