抽屉物品不会被嵌套布局点击

时间:2014-12-11 23:26:07

标签: android layout drawer

我无法点击具有此嵌套布局的抽屉物品

只有当我在所有其他视图的末尾移动DrawerLayout时,我才能点击它的项目,但在这种情况下,所有其他视图都与抽屉重叠

将抽屉添加到这样的嵌套布局中的正确方法是什么?

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <!-- The main content view -->
    <FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <!-- The navigation drawer -->
    <ListView
        android:id="@+id/left_drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#111"
        android:choiceMode="singleChoice"
        android:dividerHeight="0dp" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/bg_sky">

        <RelativeLayout
            android:id="@+id/header"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true">



            <AutoCompleteTextView
                android:id="@+id/cityTV"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="true"
                android:clickable="true"

                android:gravity="left"
                android:hint="@string/cityhint"
                android:inputType="textMultiLine|textFilter|textVisiblePassword|textNoSuggestions"
                android:shadowColor="@color/text_shadow"
                android:shadowDx="1"
                android:shadowDy="1"
                android:shadowRadius="6"
                android:textColor="@color/light_font"
                android:textColorHint="@color/grey_font"
                android:textSize="60sp" />

        </RelativeLayout>


        <RelativeLayout
            android:id="@+id/footer"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:alpha="0.7">

            <ImageView
                android:id="@+id/alarmView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="true"
                android:paddingRight="5dp"
                android:src="@drawable/alarm" />

            <ImageView
                android:id="@+id/internetConn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@+id/closeButton"
                android:layout_toEndOf="@+id/alarmView"
                android:layout_toRightOf="@+id/alarmView"
                android:paddingRight="5dp"
                android:src="@drawable/internet" />

            <ImageView
                android:id="@+id/soundIcon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@+id/closeButton"
                android:layout_toEndOf="@+id/internetConn"
                android:layout_toRightOf="@+id/internetConn"
                android:paddingRight="5dp"
                android:src="@drawable/sound" />

            <Button
                android:id="@+id/closeButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:alpha="1"
                android:background="@drawable/common_full_open_on_phone"
                android:focusable="true"
                android:onClick="closeApp"
                android:text="@string/closeButton" />


        </RelativeLayout>


        <RelativeLayout
            android:id="@+id/center"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            android:layout_above="@id/footer"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_below="@+id/header">

            <TextView
                android:id="@+id/precipMM_value_tv"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentRight="true"
                android:layout_alignParentStart="true"
                android:layout_below="@+id/descrTV"
                android:layout_marginTop="42dp"
                android:layout_toEndOf="@+id/tempC_value"
                android:singleLine="false"
                android:text="@string/nodata" />

            <TextView
                android:id="@+id/descrTV"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="true"
                android:layout_marginTop="31dp"
                android:layout_toEndOf="@+id/precipMM_value_tv"
                android:focusable="true"
                android:text="@string/nodata" />

            <TextView
                android:id="@+id/obsTime_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_alignParentStart="true"
                android:layout_below="@+id/descrTV"
                android:layout_marginTop="37dp"
                android:layout_toEndOf="@+id/descrTV"
                android:gravity="right"
                android:singleLine="false"
                android:text="@string/nodata" />

            <TextView
                android:id="@+id/tempC_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_marginBottom="0dp"
                android:shadowColor="@color/text_shadow"
                android:shadowDx="1"
                android:shadowDy="1"
                android:shadowRadius="6"
                android:text="@string/nodata"
                android:textColor="@color/light_font"
                android:textIsSelectable="false"
                android:textSize="80dp" />

        </RelativeLayout>





    <ProgressBar
        android:id="@+id/address_progress"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:indeterminate="true"

        android:visibility="gone" />


</RelativeLayout>

</android.support.v4.widget.DrawerLayout>

0 个答案:

没有答案