2015-06-18 52 views
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" 


    tools:context="com.mettl.zobbr.SliderActivity" > 

    <RelativeLayout 
     android:id="@+id/dddd" 
    android:layout_width="fill_parent" 
    android:isScrollContainer="false" 
    android:layout_height="wrap_content" > 




    <ImageView 
     android:id="@+id/Button06" 
     style="?android:attr/buttonStyleSmall" 
     android:layout_width="wrap_content" 
     android:layout_height="72dp" 
     android:layout_alignParentLeft="true" 
     android:isScrollContainer="false" 


     android:layout_alignParentTop="true" 
     android:background="@drawable/spin_title" /> 


     <Button 
     android:id="@+id/button9" 
     style="?android:attr/buttonStyleSmall" 
     android:layout_width="wrap_content" 
     android:layout_marginLeft="85dp" 
     android:background="#00000000" 
     android:isScrollContainer="false" 
     android:onClick="BackToJob" 
     android:layout_height="wrap_content" 
     android:layout_alignBottom="@+id/button8" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentTop="true" /> 

    <Button 
     android:id="@+id/button8" 
     style="?android:attr/buttonStyleSmall" 
     android:background="#00000000" 
     android:isScrollContainer="false" 
     android:layout_marginLeft="160dp" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:onClick="BackToLoc" 
     android:layout_alignLeft="@+id/button7" 
     android:layout_alignParentTop="true" /> 

    </RelativeLayout> 

    <ScrollView 

     android:layout_below="@+id/dddd" 
    android:layout_width="fill_parent" 
    android:background="@drawable/spin_back" 
    android:layout_height="fill_parent" 
    android:layout_alignParentBottom="true" 
    > 

    <RelativeLayout 
     android:layout_below="@+id/dddd" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    > 




     <kankan.wheel.widget.WheelView android:id="@+id/hour" 
      android:layout_height="wrap_content" 


      android:layout_marginLeft="85dp" 
       android:layout_marginTop="70dp" 
      android:layout_width="75dp"/> 

     <kankan.wheel.widget.WheelView android:id="@+id/second" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="15dp" 

       android:layout_marginTop="70dp" 
      android:layout_toRightOf="@+id/hour" 

      android:layout_width="75dp"/> 


     <TextView 
     android:id="@+id/textView124" 
     android:layout_toRightOf="@+id/second" 
     android:layout_width="wrap_content" 
     android:textSize="25dp" 

     android:textColor="#000000" 
     android:layout_height="wrap_content" 
      android:layout_marginTop="70dp" 
      android:layout_marginLeft="10dp" 

     android:layout_alignParentRight="true" 
     android:paddingTop="65dp" 
     android:text="000/-" /> 




      <EditText 
     android:id="@+id/textView1234" 
     android:layout_toRightOf="@+id/second" 
     android:layout_width="wrap_content" 
     android:textSize="25dp" 

     android:layout_marginLeft="100dp" 
     android:layout_marginRight="100dp" 
     android:gravity="center" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true" 
     android:maxLength="10" 
     android:inputType="number" 

     android:focusableInTouchMode="true" 

     android:layout_height="wrap_content" 

     android:layout_below="@+id/hour" 

     android:paddingTop="95dp" 
     /> 







</RelativeLayout> 
</ScrollView> 


    <LinearLayout 
     android:id="@+id/btnLL" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true"> 


    <Button 
     android:id="@+id/button12" 
     android:layout_width="0dp" 
     android:layout_height="40dp" 
     android:layout_weight="3" 
     android:onClick="refresh" 
     android:layout_marginLeft="10dp" 
     android:layout_marginRight="10dp" 
     android:layout_marginBottom="10dp" 
     android:background="@drawable/veri_button"/> 
    <Button 
     android:id="@+id/button2" 
     android:layout_width="50dp" 
     android:layout_height="40dp" 
     android:layout_marginBottom="10dp" 
      android:layout_marginRight="10dp" 
      android:layout_marginLeft="10dp" 
     android:layout_weight="1" 
     android:background="@drawable/button_background_selector" 
     /> 


    </LinearLayout> 
</RelativeLayout> 

但是,当我点击第二个布局的编辑文本。 softKeyboard将第一个布局推出屏幕(第一个布局位于屏幕顶部)。

我已经使用android:isScrollContainer="false",但没有达到要求的结果。 我已将android:windowSoftInputMode="adjustPan"添加到清单中。仍然没有工作。

+0

删除标记机器人。 它肯定会工作。只是检查它。 – Napolean

+0

我已经做了这个改变。但同样的错误再次发生。 –

回答

0

尝试在您的清单,而不是:

android:windowSoftInputMode="adjustPan" 

使用:从清单windowSoftInputMode = “adjustPan”:

android:windowSoftInputMode="adjustNothing" 
+0

这阻止了上部布局被推高。但现在较低的布局没有被推高。 softKeyBoard隐藏了EditextView。我想要做的只是向上滚动底部视图来查看文本。但上面的观点仍然没有改变。 –

+0

如果你想要这种效果,你的布局的滚动视图会更有用 –

+0

好吧,我不确定是否正确。我在scrollView中添加了第二个相对视图。但同样的问题仍然存在。我用新的版面编辑了这个问题。 –

相关问题