开发者

How can i limit the size of a sliding drawer? [duplicate]

开发者 https://www.devze.com 2023-02-16 13:45 出处:网络
This question already has answers here: 开发者_JAVA百科 Closed 11 years ago. Possible Duplicate: Android: can height of SlidingDrawer be set with wrap_content?
This question already has answers here: 开发者_JAVA百科 Closed 11 years ago.

Possible Duplicate:

Android: can height of SlidingDrawer be set with wrap_content?

Is there a way to change the size of a sliding drawer when it opens ? And is there a way to place it in the top, or in the left, because the default option are bottom for the vertical orientation and right to the horizontal orientation.


This answer about overriding SlidingDrawer#onMeasure to enable wrap_content for SlidingDrawer seems like a winner.

The onMeasure() method of the SlidingDrawer class basically overrides the layout modes to fill_parent, this is why layout_height="wrap_content" is not working.

Edit - Or, you can set the height exactly in with something like layout_height="200dp".

Your other question was already answered in the negative.

0

精彩评论

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