Заставить текст редактирования занимать весь экран в режиме прокрутки

у меня появляется поле EditText внутри LinearLayout , которое находится в режиме прокрутки. Пока ScrollView отсутствует, layout_weight = "1.0" позволяет моему EditText занимать оставшийся экран. Но как только я заключу LinearLayout в ScrollView , он меняет EditText на одну строку, и layout_weight не работает.

Мой полный файл макета

<LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android"  android:layout_width="match_parent" android:layout_height="fill_parent"     android:orientation="vertical" >        

<TextView android:id="@+id/titleTextView"       
          style="@style/TitleHeaderBarText"     
          android:text="@string/announcement" />        

<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="fill_parent" > 

    <LinearLayout  
         android:layout_width="match_parent" 
         android:layout_height="fill_parent"    
         android:orientation="vertical" 
         android:gravity="right" >

                <TextView 
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Subject:" 
                    android:textSize="16sp" />

                <EditText 
                    android:id="@+id/et_subject"
                    android:layout_width="match_parent" 
                    android:layout_height="wrap_content" />

               <TextView
                    android:layout_width="match_parent" 
                    android:layout_height="wrap_content"
                    android:text="Announcement:" 
                    android:textSize="16sp" />

                <EditText
                    android:id="@+id/et_announcement"
                    android:layout_width="match_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1.0" />

                <Button
                    android:id="@+id/btn_save"
                    android:layout_width="wrap_content" 
                    android:layout_height="wrap_content"
                    android:paddingLeft="24sp" 
                    android:paddingRight="24dp"
                    android:text="Save" />      

       </LinearLayout>  
</ScrollView>

</LinearLayout>

Кажется, я не понимаю, что делаю неправильно. Любые предложения, пожалуйста, о том, как заставить EditText занимать остальную часть экрана из LinearLayout , который находится в ScrollView .

Спасибо.

EDIT ] Опять сталкиваюсь с той же проблемой, и это мой макет.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView android:id="@+id/titleTextView"
        style="@style/TitleHeaderBarText"
        android:text="@string/login_title" />

    <ScrollView
        android:id="@+id/sv_weight_tell_us"
        android:layout_width="match_parent" android:layout_height="match_parent"
        android:background="@drawable/bg_light_radial_pink" >
        <LinearLayout 
            android:layout_width="match_parent" android:layout_height="match_parent"
            android:padding="12dp"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/login_header"
                android:layout_width="match_parent" android:layout_height="wrap_content"
                android:text="Login" />

            <TableLayout 
                android:layout_width="match_parent" android:layout_height="wrap_content"
                android:stretchColumns="1" >
                <TableRow>
                    <TextView
                        android:layout_width="wrap_content" android:layout_height="wrap_content"
                        android:paddingRight="20dp"
                        android:text="@string/username" />
                    <EditText
                        android:id="@+id/et_username"
                        android:layout_width="wrap_content" android:layout_height="wrap_content" />
                </TableRow>
                <TableRow>
                    <TextView
                        android:layout_width="wrap_content" android:layout_height="wrap_content"
                        android:text="@string/password" />
                    <EditText
                        android:id="@+id/et_password"
                        android:layout_width="wrap_content" android:layout_height="wrap_content"
                        android:inputType="textPassword" />
                </TableRow>
                <TableRow>
                    <View/>
                    <Button
                        android:id="@+id/btn_login"
                        android:layout_width="wrap_content" android:layout_height="wrap_content"
                        android:text="@string/login"
                        android:padding="12dp" />
                </TableRow>
            </TableLayout>

            <ProgressBar
                android:id="@+id/pb_1"
                android:layout_width="wrap_content" android:layout_height="wrap_content"
                android:indeterminate="true"
                style="?android:attr/progressBarStyleSmall"
                android:visibility="invisible" />

            <TextView
                android:layout_width="wrap_content" android:layout_height="match_parent"
                android:layout_weight="1.0" android:gravity="bottom"
                android:text="@string/dont_have_Q" />           
            <TextView
                android:id="@+id/tv_sign_up"
                android:layout_width="wrap_content" android:layout_height="wrap_content"
                android:text="@string/sign_up_" />

        </LinearLayout>
    </ScrollView>

</LinearLayout>
5
задан Chris 14 January 2015 в 12:24
поделиться