0

Androidで左から右にスライドドロワーを作成する方法の簡単な例を誰か教えてください。インターネットをよく検索しましたが、適切な解決策を得ることができませんでした。あなたの返事を待っています。ありがとうございました :)

4

1 に答える 1

0

横引き引出しは下記コードをご利用ください。

main.xml

<?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">

    <ImageView 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:src="@drawable/icon"/>

    <SlidingDrawer
        android:id="@+id/drawer"
        android:layout_width="fill_parent"
        android:layout_height="fill_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/icon"/>
        <LinearLayout
            android:id="@id/content"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical"
            android:padding="10dp"
            android:background="#55000000">
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
        </LinearLayout>
    </SlidingDrawer>
</FrameLayout>

以下の例のリンクを参考にしてください。

水平方向の SlidingDrawer - 1

水平方向の SlidingDrawer - 2

于 2012-07-12T11:26:59.610 に答える