Brad Active Member Licensed User Longtime User Mar 25, 2011 #1 Is there a way for the spinner to auto size to the selected text like it does in Java?
klaus Expert Licensed User Longtime User Mar 25, 2011 #2 Yes, set the width of the Spinner to -2. Code: [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Spinner1.Width=-[/SIZE][/FONT][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] Width can have two special values: -1 fill_parent / match_parent -2 wrap_content Attached a small test program. If the text length is wider than the device width, the Spinner width is set to the device width. In this case, if the Left property is >0 then a part of the right side of the Spinner will be out of the screen. Best regards. Attachments SpinnerAutoWidth.zip SpinnerAutoWidth.zip 5.8 KB · Views: 556 Last edited: Jun 3, 2016 Upvote 0
Yes, set the width of the Spinner to -2. Code: [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Spinner1.Width=-[/SIZE][/FONT][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] Width can have two special values: -1 fill_parent / match_parent -2 wrap_content Attached a small test program. If the text length is wider than the device width, the Spinner width is set to the device width. In this case, if the Left property is >0 then a part of the right side of the Spinner will be out of the screen. Best regards.