2013-06-06 2 views
1

Я использую эту схему:Scrollview не работает в моем макете

<?xml version="1.0" encoding="UTF-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/scroller" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:fillViewport="true" 
    android:background="#00868B"> 


<RelativeLayout 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
> 

    <TextView android:layout_height="wrap_content" 
     android:layout_width="fill_parent" 

     android:gravity="center" 
     android:layout_alignParentTop="true" 
     /> 
    <EditText 

    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 


    /> 

    <TextView android:layout_height="wrap_content" 
     android:layout_width="fill_parent" 
     android:gravity="center" 
     android:layout_below="@+id/title" /> 

    <EditText 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 

    /> 


<Button .. 
    android:layout_width="match_parent" 
    android:layout_height="50dp" 
    android:text="@string/getloc" 

    /> 

<Button .. 
    android:layout_width="match_parent" 
    android:layout_height="50dp" 


    /> 

<Button .. 
    android:layout_width="match_parent" 
    .. 
    android:layout_alignParentBottom="true" 

    /> 

</RelativeLayout> 



</ScrollView> 

Там нет Scrollview. Я хочу, когда пользователь вводит sth во втором текстовом представлении, чтобы «спуститься», потому что иначе текстовое изображение становится больше, но первая кнопка устойчива и блокирует представление.

ответ

0

Если вы хотите избежать появления кнопок при появлении клавиатуры, вы можете поставить android:windowSoftInputMode="adjustNothing" на узел активности вашего манифеста Android. Тогда они не будут беспокоить вас при наборе текста.

+1

: В основном, я хочу использовать scrollview.I пробовал то, что вы говорите, но все тот же. – George

+0

да, та же проблема, с которой я сталкиваюсь -------- scrollview не работает с настройкой – NarendraJi

0

Хорошо, я нашел.

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/scroller2" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:fillViewport="true" 
    android:background="#00868B"> 

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    > 

<RelativeLayout 

android:layout_width="match_parent" 
android:layout_height="wrap_content" 
> 

<TextView android:layout_height="wrap_content" 


    <EditText 

    /> 

    <TextView android:layout_height="wrap_content" 


    <EditText 

    /> 
    </RelativeLayout> 
<Button 

    /> 

<Button 

    /> 

<Button 

    /> 

</LinearLayout> 
</ScrollView> 
Смежные вопросы