Android:有没有一种方法可以将SlidingDrawer的宽度和高度正确设置为半屏?

Android:有没有一种方法可以将SlidingDrawer的宽度和高度正确设置为半屏?,第1张

概述我必须在右侧设置一个SlidingDrawer并单击,它不应在半屏上展开.我看到了很多tuto,并且设法或多或少正确地设置了它,但是当前它正在将布局中的所有内容推到左侧.这是我的xml:<LinearLayoutandroid:layout_height="wrap_content"android:id="@+id/edition_content_linear"and

我必须在右侧设置一个SlIDingDrawer并单击,它不应在半屏上展开.我看到了很多tuto,并且设法或多或少正确地设置了它,但是当前它正在将布局中的所有内容推到左侧.这是我的xml:

<linearLayout androID:layout_height="wrap_content"    androID:ID="@+ID/edition_content_linear" androID:layout_wIDth="fill_parent"    androID:layout_weight="1" androID:background="@androID:color/white">    <linearLayout androID:layout_wIDth="fill_parent"        androID:ID="@+ID/static_menu_layout" androID:layout_height="fill_parent"        androID:layout_weight="2" androID:visibility="gone" androID:background="@drawable/ipad_category_back">        <ExpandableListVIEw androID:ID="@+ID/static_expandable_List"            androID:layout_height="fill_parent" androID:layout_wIDth="fill_parent"            androID:drawSelectorOntop="false" androID:groupIndicator="@drawable/expandableList_selector" androID:indicatorleft="210dp" androID:indicatorRight="230dp"></ExpandableListVIEw>    </linearLayout>    <linearLayout androID:ID="@+ID/center_linear"        androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent"        androID:layout_weight="1">        <ImageVIEw androID:scaleType="centerInsIDe"            androID:layout_height="fill_parent" androID:layout_wIDth="fill_parent"            androID:ID="@+ID/cover_image_big"></ImageVIEw>        <WebVIEw androID:ID="@+ID/story_webvIEw"            androID:layout_height="fill_parent" androID:layout_wIDth="fill_parent"            androID:visibility="gone"></WebVIEw>    </linearLayout>    <SlIDingDrawer androID:ID="@+ID/slIDer_drawer"    androID:layout_wIDth="250dp" androID:layout_height="500dp"    androID:orIEntation="horizontal" androID:layout_gravity="center_vertical"    androID:handle="@+ID/slIDer_handle" androID:content="@+ID/slIDer_expandable_List_container">    <ImageVIEw androID:ID="@+ID/slIDer_handle"        androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content"        androID:src="@drawable/menu_handler" />    <relativeLayout androID:ID="@+ID/slIDer_expandable_List_container"        androID:layout_height="500dp" androID:layout_wIDth="250dp">        <ExpandableListVIEw androID:ID="@+ID/slIDer_expandable_List"            androID:layout_height="fill_parent" androID:layout_wIDth="fill_parent"            androID:drawSelectorOntop="false" androID:indicatorleft="210dp" androID:layout_gravity="center_vertical"            androID:indicatorRight="230dp" androID:groupIndicator="@drawable/expandableList_selector"></ExpandableListVIEw>    </relativeLayout>   </SlIDingDrawer></linearLayout>

解决方法:

将滑动抽屉放置在框架布局中总是更好.因为在Framelayout中,视图将彼此绘制.然后,即使您打开抽屉,它也会在下面的视图中重叠.但请注意,在Framelayout中,抽屉会扩展到所有framelayout的长度.如果要限制扩展抽屉的长度,请为父框架布局指定一个长度.

总结

以上是内存溢出为你收集整理的Android:有没有一种方法可以将SlidingDrawer的宽度高度正确设置为半屏?全部内容,希望文章能够帮你解决Android:有没有一种方法可以将SlidingDrawer的宽度和高度正确设置为半屏?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1210485.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-04
下一篇2022-06-04

发表评论

登录后才能评论

评论列表(0条)

    保存