Please support the :highlighted selector for StackLayout, FlexboxLayout, etc. It is not possible to create a button with nested images/text. It is not possible to create a StackLayout/GridLayout/FlexboxLayout for use as a button and have it change the background color on press.
https://github.com/NativeScript/NativeScript/issues/50
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Any suggestions how to implement?
in terms of UI, this would be a very nice feature to add, since I came across the lack of this functionality from the first project
Why only "Layout components"? All View components/widgets need this.
This works on Android: https://github.com/tbsf/NativeScript/commit/cc5caaec6d2e44da2f74c8d5a551dab97e13c878
I'm developing on Linux so I cannot implement fix on iOS at this time.
EDIT: Probably as simple as moving this to layout-base for iOS: https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/button/button.ios.ts#L44
+1
@tjvantoll Is this possible?
It would be very useful.
+1
Any progress? Also interested in this feature.
@sashok1337 see my earlier comment how I implemented for android. Code has changed since then but you just need to add PseudoClassHandler to the layout base https://github.com/NativeScript/NativeScript/blob/master/nativescript-core/ui/layouts/layout-base.android.ts
You can look at the button class for iOS to see how PseudoClassHandler is implemented there. It鈥檚 not difficult. Unfortunately I didn鈥檛 have access to iOS to test so I never created a PR.
Most helpful comment
in terms of UI, this would be a very nice feature to add, since I came across the lack of this functionality from the first project