1

RelativeLayout에 몇 개의 EditText가 있고 그 아래에 버튼이 정렬되어 있습니다. 키보드가 튀어 오를 때, 크기를 재조정하기를 원합니다 (따라서, android : windowSoftInputMode = "adjustResize"를 사용하고 있습니다) 작은 화면에서 크기를 조절하는 것만으로는 충분하지 않기 때문에 스크롤 가능으로하고 싶습니다.키보드가 나타나면 스크롤 뷰가 스크롤되지 않습니다.

문제는 스크롤 할 수 없다는 것입니다.

버튼이 화면 하단에 있어야합니다.

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="#FFF"> 

    <!-- some hidden RelativeLayouts, filling the whole screen --> 

<RelativeLayout 
     android:id="@+id/form_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

    <ScrollView 
     android:layout_width="match_parent" android:layout_height="match_parent" 
      android:fillViewport="true" android:layout_above="@+id/ok_btn"> 

     <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" android:background="#99000000" android:visibility="visible"> 

      <View 
      android:id="@+id/shade" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" android:layout_alignTop="@+id/logradouro1" 
      android:background="#FFF" android:layout_marginTop="-30dp"/> 

      <!-- some visible EditTexts and TextViews here --> 

     </RelativeLayout> 

    </ScrollView> 

    <Button android:id="@+id/ok_btn" 
      android:layout_width="match_parent" 
      android:layout_height="50dp" android:background="@color/verdeBotao" android:text="Cadastrar" 
      android:textColor="#FFF" android:layout_alignParentBottom="true"/> 

</RelativeLayout> 


</RelativeLayout> 

다음은 어떤 일이 벌어지고 있는지를 보여주는 2 개의 스크린 샷입니다. 키보드가 올라간 후에는 스크롤 할 수 없습니다. 감사합니다. 나는 당신의 UI와 비슷한 뭔가를 게시하고

enter image description hereenter image description here

답변

0

. 하단의 버튼에 대해 RelativeLayout을 가져옵니다. 아래로 중력을 설정하고 단추보기해야 안드로이드 : layout_alignParentBottom = "진정한"

<ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/m_table_menu" > 

     <LinearLayout 
      android:id="@+id/layuserdetails" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="8dp" 
      android:orientation="horizontal" 
      android:padding="5dp" > 

      Yourviewss......i guess edittexts 

     </LinearLayout> 
    </ScrollView> 

// 스크롤 버튼 레이아웃

<RelativeLayout 
     android:id="@+id/m_table_menu" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:gravity="bottom" 
     android:padding="0dp" > 

     <LinearLayout 
      android:id="@+id/laysharepost" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:gravity="bottom" 
      android:orientation="vertical" 
      android:padding="5dp" > 

//replace textview with buttonview.. 
      <TextView 
       android:id="@+id/share_tvcommentdone" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:background="@drawable/button_selector" 
       android:padding="10dp" 
       android:text="POST" 
       android:textColor="@android:color/white" /> 
     </LinearLayout> 
    </RelativeLayout> 
+0

당신이있는 ScrollView를 사용하지 않는? 작은 화면을 처리하는 데 사용해야한다고 생각합니다 –

+0

내 문제는 어떻게 든 android : layout_alignParentBottom = "true"'ScrollView –

+0

에있는 뷰에서 설정하는 것과 관련이 있습니다. 선형 레이아웃을 rootelement로 사용합니다. 시도 해봐. –

관련 문제