I have a problem with Scrollview on Android. The problem is showing all content in a register form.
XML Layout
<LinearLayout
xmlns:android="http://ift.tt/nIICcg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/app_background"
tools:context=".RegisterActivity"
xmlns:tools="http://ift.tt/LrGmb4">
<ScrollView
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:paddingLeft="10dp"
android:paddingRight="10dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/register_header"
android:textSize="30sp"
android:textColor="#000000"
android:textStyle="bold"
android:layout_marginBottom="30dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register_loginField"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="18sp"
android:layout_marginBottom="8dp"
/>
<EditText
android:id="@+id/register_input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:textColor="#000000"
android:hint="@string/hint_login"
android:layout_marginBottom="20dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register_password"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="18sp"
android:layout_marginBottom="20dp"
/>
<EditText
android:id="@+id/register_input_passw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:textColor="#000000"
android:hint="@string/hint_passw"
android:layout_marginBottom="20dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register_repeatpass"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="18sp"
android:layout_marginBottom="20dp"
/>
<EditText
android:id="@+id/register_input_passwre"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:textColor="#000000"
android:hint="@string/hint_passw"
android:layout_marginBottom="20dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register_gender"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="18sp"
android:layout_marginBottom="20dp"
/>
<RadioGroup
android:id="@+id/register_radiog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<RadioButton
android:id="@+id/register_radioM"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register_gMale"
android:textSize="16sp"
/>
<RadioButton
android:id="@+id/register_radioF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register_gFemale"
android:textSize="16sp"
android:layout_marginBottom="20dp"
/>
</RadioGroup>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register_name"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="18sp"
/>
<EditText
android:id="@+id/register_input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:textColor="#000000"
android:hint="@string/hint_name"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register_age"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="18sp"
/>
<EditText
android:id="@+id/register_input_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:textColor="#000000"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/register_input_termsofuse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/register_termsofuse"
android:textSize="16sp"
android:textColor="#000000"
android:textStyle="bold"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/register_btSignup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#fc9a24"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:text="@string/register_btSignup"
android:textStyle="bold"
android:textSize="16sp"
android:textColor="#FFFFFF"
/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
But when I execute in my Android device I can't see the register_header textview.
Also when I click on one EditText, my device show keyboard, and all view is pushed up, hidding more items (email textview and edittext).
How can I solve this?
In this first image, as you can see header isn't showing. This is bad...
In this second image, I can scroll and see register button, this is good.
And in this third image, when keyboard appears and I go to top of the scrollview I can't see the register_header, the email input and email textview
How can I, fix layout position (not push up when keyboard appears) and show all content inside Scrollview.
Thx
Aucun commentaire:
Enregistrer un commentaire