开发者

Only show the arrowbutton of a spinner

I would like to use a spinner but only show the arrow on the right side like Android does in it's settings menu. (like for example by Screen timeout)

I can set the width to +/- 65开发者_JS百科px but then I've only got rounded corners on the rightside and not the left.

Thnx for your help!

Patrick


Are you sure they use a spinner?

You could achieve the same thing by simply placing a round button to the right-hand side and when pressed it triggers a popup ListView. The drawable for that button is...

"@drawable/ic_btn_round_more_normal"


If you are just trying to get it the dropdown to be all the way to the right rather than narrower, you can simply set the tag on the spinner in the xml to use android:layout_width="fill_parent". If you want to just have the button without the border, the Android Preferences have their own layout objects. I have just asked at elsewhere how to get those elements in a non-preferances view: Howto make a layout similar to the ones in settings.


What I did is the following: Set the layout_width of the Spinner to 48dp and in code set an adapter which serves views with a size of 0dp x 0dp. The dropdown view is a normal (visible) view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜