화면에 맞지 않는 TextView를 사용하여 큰 텍스트 블록을 표시하려고합니다. ScrollView를 사용하여이 뷰를 둘러 보았습니다. 격리되어 사용되면 작동합니다. DrawerLayout을 추가하려고하면 스크롤 가능한 액션이 더 이상 작동하지 않습니다 (그러나 DrawerLayout은 작동합니다). FrameLayout을 사용하는 DrawerLayouts 요구 사항 때문이라고 추측합니다. 아래는 내가 사용하고있는 XML 코드입니다. 대부분의 코드는 크게 감상 할 수 http://developer.android.com/training/implementing-navigation/nav-drawer.html동일한 활동에서 서랍 레이아웃 및 스크롤보기 사용
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
>
<TextView
android:id="@+id/city_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textStyle="bold"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/white"
/>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:layout_below="@+id/city_title">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/city_details"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/white"/>
</LinearLayout>
</ScrollView>
<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">
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
모든 팁이나 조언에 drawerlayout에 대한 구글의 튜토리얼을 따른다.
서랍 레이아웃을 잘못 지정했습니다. 당신이 연결된 문서화를 다시 읽고, 이후 이것 좀 있습니다 http://stackoverflow.com/questions/17496007/edittext-inside-of-a-drawerlayout/17496206#answer-17496206 – LuckyMe
는 왜 둘 것을 DrawerLayout ** 내부 ** RelativeLayout? – Sloy