Я потратил некоторое время на это, и я не могу заставить ScrollView работать в моем приложении для Android. Я тестирую его в Android Emulator, так как у меня сейчас нет Android-устройства. Я знаю, что это должна быть глупая проблема, но я не могу понять это!ScrollView не работает - Android
XML-код:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:tools="http://schemas.android.com/tools"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="generalclasses.MainActivity$PlaceholderFragment" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="@string/signintextview"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="@+id/useridtext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/usertextview"
android:layout_below="@+id/usertextview"
android:layout_marginTop="25dp"
android:ems="10"
android:hint="@string/hintusuario" />
<TextView
android:id="@+id/usertextview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:layout_marginTop="23dp"
android:text="@string/usertextview"
android:textSize="20sp" />
<Button
android:id="@+id/signupherebutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/signinbutton"
android:text="@string/signupherebutton" />
<TextView
android:id="@+id/passwordtextview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/useridtext"
android:layout_below="@+id/useridtext"
android:layout_marginTop="24dp"
android:text="@string/passwordtextview"
android:textSize="20sp" />
<EditText
android:id="@+id/passwordedittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/passwordtextview"
android:layout_below="@+id/passwordtextview"
android:layout_marginTop="26dp"
android:ems="10"
android:hint="@string/hintsenha"
android:inputType="textPassword" />
<TextView
android:id="@+id/newheretextview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/signupherebutton"
android:layout_alignBottom="@+id/signupherebutton"
android:layout_alignLeft="@+id/signinbutton"
android:layout_marginLeft="30dp"
android:text="@string/newheretextview"
android:textSize="20sp" />
<Button
android:id="@+id/signinbutton"
style="@style/AppBaseTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/passwordedittext"
android:layout_below="@+id/passwordedittext"
android:layout_marginTop="27dp"
android:text="@string/signinbutton" />
</RelativeLayout>
</ScrollView>
Вы пытались переместить инструменты линии: контекст в вашем scrollView? –
Возможно, вы нажимаете на edittext и пытаетесь прокручивать. Если это так, попробуйте нажать где-нибудь еще в макете и попробуйте прокрутить. У вас есть элементы, которые не видны на экране, но представлены в макете? – SKT