2016-10-10 45 views
0

我遇到了一個錯誤的麻煩。我搜查了很多,發現了一些解決方案,然後應用,但無法解決我的問題。當我點擊edittext我的toolbar推起來,並沒有看到。我嘗試Android: Resize only parts of view with soft keyboard on screen這種解決辦法,但不能得到結果。我該如何解決這個問題? `Softkeyboard可見時工具欄向上推

<ScrollView 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@+id/scroll_comment" 
    android:layout_above="@+id/footerrr"> 

    <LinearLayout 
     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" 
     android:orientation="vertical"> 

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

      <TextView 
       android:id="@+id/textView" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="10dp" 
       android:layout_weight="6" 
       android:padding="16dp" 
       android:text="Android charting application xml ui design tutorial with example. Android charting application xml ui design tutorial with example. Android charting application xml ui design tutorial with example. Android charting application xml ui design tutorial with example." 
       android:textColor="#000" /> 


     </LinearLayout> 

     <LinearLayout 
      android:id="@+id/layout2" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/layout1" 
      android:layout_marginTop="30dp" 
      android:orientation="horizontal"> 


      <TextView 
       android:id="@+id/textView1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="10dp" 
       android:layout_weight="6" 
       android:padding="16dp" 
       android:text="Android charting application xml ui design. Android charting application xml ui design tutorial with example. Android charting application xml ui design. Android charting application xml ui design. " 
       android:textColor="#000" /> 

     </LinearLayout> 

     <LinearLayout 
      android:id="@+id/layout3" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/layout2" 
      android:layout_marginTop="20dp" 
      android:orientation="horizontal"> 

      <TextView 
       android:id="@+id/textView3" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="10dp" 
       android:layout_weight="6" 
       android:padding="16dp" 
       android:text="Android charting application xml ui design tutorial with example. Android charting application xml ui design tutorial with example. Android charting application xml ui design tutorial with example. Android charting application xml ui design tutorial with example." 
       android:textColor="#000" /> 


     </LinearLayout> 

     <LinearLayout 
      android:id="@+id/layout4" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/layout3" 
      android:layout_marginTop="30dp" 
      android:orientation="horizontal"> 


      <TextView 
       android:id="@+id/textView5" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="10dp" 
       android:layout_weight="6" 
       android:padding="16dp" 
       android:text="Android charting application xml ui design. Android charting application xml ui design tutorial with example. Android charting application xml ui design. Android charting application xml ui design. " 
       android:textColor="#000" /> 
     </LinearLayout> 
    </LinearLayout> 
</ScrollView> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="#fff" 
    android:layout_alignParentBottom="true" 
    android:orientation="horizontal" 
    android:id="@+id/footerrr"> 

    <EditText 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:textColorHint="#CFD8DC" 
     android:textColor="#CFD8DC" 
     android:hint="Write a message" 
     android:id="@+id/edittt" 
     android:focusable="true" 
     /> 

    <ImageView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="5" 
     android:padding="4dp" 
     android:src="@android:drawable/ic_menu_send" /> 
</LinearLayout> 

`enter image description here

enter image description here

+0

發佈你的XML完整的代碼? – Ironman

+0

爲什麼在打字時需要看到工具欄? –

回答

0

如你不張貼Xml代碼,我寫了直接的解決辦法是,你必須android:isScrollContainer="false"屬性添加到您的ScrollView它會解決這個問題。

代碼這樣

<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:isScrollContainer="false" > 
</ScrollView> 
+0

我試過了,但解決不了 –