<?xml version="1.0" enCoding="utf-8"?> <FrameLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent"> <linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:background="@drawable/bg" androID:orIEntation="vertical" > <button androID:ID="@+ID/ship" androID:layout_wIDth="186dp" androID:layout_height="23dp" androID:layout_margintop="49dp" androID:background="@drawable/signup" androID:text="ShipPing Calculator" androID:textcolor="#ffffffff" androID:layout_gravity="center" androID:textStyle="bold" /></linearLayout><SlIDingDrawer androID:ID="@+ID/drawer" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:orIEntation="horizontal" androID:handle="@+ID/handle" androID:content="@+ID/content"> <ImageVIEw androID:ID="@+ID/handle" androID:layout_wIDth="wrap_content" androID:layout_height="fill_parent" androID:src="@drawable/tag"/> <linearLayout androID:ID="@+ID/content" androID:layout_wIDth="wrap_content" androID:layout_height="fill_parent" androID:background="@drawable/slIDimage" androID:orIEntation="vertical" androID:@R_301_5095@="10dp" > <TextVIEw androID:ID="@+ID/text1" androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content" androID:layout_gravity="center" androID:layout_margintop="15dp" androID:layout_marginleft="51dp" androID:text="SIGN-UP" androID:textcolor="#000000" androID:textSize="28dp" androID:textStyle="bold" /> </linearLayout> </SlIDingDrawer> <SlIDingDrawer androID:ID="@+ID/drawers" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:handle="@+ID/handles" androID:layout_gravity="left" androID:scrollX="100dp" androID:orIEntation="horizontal" androID:content="@+ID/contents"> <ImageVIEw androID:ID="@+ID/handles" androID:layout_wIDth="wrap_content" androID:layout_height="fill_parent" androID:layout_gravity="left" androID:src="@drawable/tag"/> <linearLayout androID:ID="@+ID/contents" androID:layout_wIDth="wrap_content" androID:layout_height="fill_parent" androID:layout_gravity="left" androID:background="@drawable/slIDimage" androID:orIEntation="vertical" androID:@R_301_5095@="10dp" > <TextVIEw androID:ID="@+ID/text1" androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content" androID:layout_gravity="center" androID:layout_margintop="15dp" androID:layout_marginleft="51dp" androID:text="SIGN-UP" androID:textcolor="#000000" androID:textSize="28dp" androID:textStyle="bold" /> </linearLayout> </SlIDingDrawer> </FrameLayout>解决方法 我在这里静态地得到了答案,它不可能创建滑动,我们不能使用androID:rotation = 180,因为它会显示错误,因为没有找到资源,我们必须以编程方式创建它.它需要在布局中添加视图.
在单面的情况下,通过使用小部件简单而不需要任何视图.但是当您想要在多个方向上滑动时需要视图.
<SlIDingDrawer androID:ID="@+ID/drawer" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:orIEntation="horizontal" androID:handle="@+ID/handle" androID:content="@+ID/content"> <ImageVIEw androID:ID="@+ID/handle" androID:layout_wIDth="wrap_content" androID:layout_height="fill_parent" androID:src="@drawable/tag"/> <linearLayout androID:ID="@+ID/content" androID:layout_wIDth="wrap_content" androID:layout_height="fill_parent" androID:background="@drawable/slIDimage" androID:orIEntation="vertical" androID:@R_301_5095@="10dp" > <TextVIEw androID:ID="@+ID/text1" androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content" androID:layout_gravity="center" androID:layout_margintop="15dp" androID:layout_marginleft="51dp" androID:text="SIGN-UP" androID:textcolor="#000000" androID:textSize="28dp" androID:textStyle="bold" /> </linearLayout> </SlIDingDrawer>
activity.java:
@OverrIDe public voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVIEw(R.layout.slIDer);}总结
以上是内存溢出为你收集整理的android – 如何在彼此相对的两侧创建滑动抽屉?全部内容,希望文章能够帮你解决android – 如何在彼此相对的两侧创建滑动抽屉?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)