[Enhancement] ImageButton #1724
Comments
I feel like this might be better as a new control instead of using Button.Image. That will prevent us from breaking old layouts. Plus, we probably want to use the native ImageButton controls, so we'll have a lot of code switches if we just reuse the same control. |
@StephaneDelcroix @samhouts The Image Button in the xamarin forms labs kind of captures what I'm thinking Android is really the only platform that has a specific "ImageButton" which derives from ImageView opposed to TextView and who's main differentiating features are a lack of a "setText" method and the idea of PushStates iOS sets the image of a button via UIControlState And with UWP we'd have to use VisualStates But I feel like with this one we'll want to add a state structure or just properties that lets you depict the image to use for Focused, Pressed, Normal, Disabled Or I know there's a VisualStateManager coming to Forms. Would it be better to just leverage that once it's prime time? @hartez |
Rationale
The current Button.Image property is mainly for displaying a small icon next to the text.
To avoid breaking changes, we should create a new ImageButton control. Both Button and ImageButton should derive from a common ButtonBase.
Implementation
see Button API, but skip the Label
Implementation on Android, iOS, UWP in renderers.
Backward Compatibility
Difficulty: Medium
The text was updated successfully, but these errors were encountered: