2015-07-17 5 views
1

Я разработал экран регистрации, в котором у меня есть Scroll view, но Scroll view не работает.Прокрутка не активируется

Я не могу найти, почему Scroll не работает, помогите мне с этим.

Ниже приведен код для справки:

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

    <include 
     android:id="@+id/tool_bar" 
     layout="@layout/tool_bar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 
<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fillViewport="true" 
    > 
    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     > 

     <ImageView 
      android:id="@+id/sign_up_profile_image" 
      android:layout_width="64dp" 
      android:layout_height="64dp" 
      android:layout_centerHorizontal="true" 
      android:layout_marginTop="30dp" 
      android:background="@drawable/shape_rectangle_rounded_corner" 
      android:padding="10dp" 
      android:scaleType="fitXY" 
      android:src="@drawable/icon_avatar" /> 


     <RelativeLayout 
      android:id="@+id/container_two" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_above="@+id/container_three" 
      android:layout_below="@+id/sign_up_profile_image" 
      android:layout_marginLeft="16dp" 
      android:layout_marginRight="16dp" 
      android:layout_marginTop="20dp" 
      android:orientation="vertical"> 

      <LinearLayout 
       android:id="@+id/first_last_name_container" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal" 
       android:weightSum="100"> 

       <ui.customviews.MaterialEditText 
        android:id="@+id/sign_up_first_name_edit_text" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginRight="1dp" 
        android:layout_marginTop="2dp" 
        android:layout_weight="50" 
        android:hint="@string/first_name_hint" 
        android:imeOptions="actionNext" 
        android:inputType="textPersonName" 
        android:textSize="18sp" 
        app:baseColor="#363636" 
        app:floatingLabel="normal" 
        app:primaryColor="#000000" /> 

       <customviews.MaterialEditText 
        android:id="@+id/sign_up_last_name_edit_text" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginLeft="1dp" 
        android:layout_marginTop="2dp" 
        android:layout_weight="50" 
        android:hint="@string/last_name_hint" 
        android:imeOptions="actionNext" 
        android:inputType="textPersonName" 
        android:textSize="18sp" 
        app:baseColor="#363636" 
        app:floatingLabel="normal" 
        app:primaryColor="#000000" /> 
      </LinearLayout> 

      <ui.customviews.MaterialEditText 
       android:id="@+id/sign_up_email_edit_text" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/first_last_name_container" 
       android:hint="@string/email" 
       android:imeOptions="actionNext" 
       android:inputType="textEmailAddress" 
       android:textSize="18sp" 
       app:baseColor="#363636" 
       app:floatingLabel="normal" 
       app:primaryColor="#000000" 

       /> 

      <ui.customviews.MaterialEditText 
       android:id="@+id/sign_up_password_edit_text" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/sign_up_email_edit_text" 
       android:hint="@string/password" 
       android:imeOptions="actionDone" 
       android:inputType="textPassword" 
       android:textSize="18sp" 
       app:baseColor="#363636" 
       app:floatingLabel="normal" 
       app:primaryColor="#000000" /> 

     </RelativeLayout> 


     <RelativeLayout 
      android:id="@+id/container_three" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:layout_marginBottom="@dimen/activity_vertical_margin"> 


      <TextView 
       android:id="@+id/sign_up_terms_text_view" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="5dp" 
       android:layout_marginLeft="16dp" 
       android:layout_marginRight="16dp" 
       android:gravity="center_horizontal" 
       android:lineSpacingExtra="2dp" 
       android:lineSpacingMultiplier="1.2" 
       android:text="By signing up, you accept to the Terms and Conditions and Privacy Policy" 
       android:textColor="#6b6b6b" 
       android:textSize="14sp" /> 

      <Button 
       android:id="@+id/sign_up_accept_button" 
       android:layout_width="match_parent" 
       android:layout_height="50dp" 
       android:layout_below="@+id/sign_up_terms_text_view" 
       android:layout_marginLeft="@dimen/activity_vertical_margin" 
       android:layout_marginRight="@dimen/activity_vertical_margin" 
       android:background="#025961" 
       android:text="@string/accept_and_signup" 
       android:textColor="@android:color/white" 
       android:textSize="14sp" /> 
     </RelativeLayout> 
    </RelativeLayout> 
</ScrollView> 

</LinearLayout> 

ответ

0

решение может быть изменить Scrollview на:

<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:fillViewport="true" 
    > 

Тогда вы должны изменить вложен о высоте расположения, а

+0

Позвольте мне попробовать, да вы просто изменили высоту – Naga

+0

Тогда я думаю, вы должны изменить вложенные макеты высот, а –

+0

Да я guising же, думая перепроектировать его, но до того, что я хотел проверить если я делаю какие-либо ошибки – Naga

0

Попробуйте Как это, Добавить внутри Линейный макет, он будет прокручиваться до конца страницы.

<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"> 

    <ScrollView 
     android:id="@+id/scrollView1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

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

// Your xml Code Put Here 

     </LinearLayout> 
    </ScrollView> 
</Relativelayout>