2011-09-06 162 views
0

我有两个编辑文本的布局和加载光标必须在第二个编辑文本。以及如何在加载时移动键盘上的编辑文本。重新大小属性不起作用。在此先感谢android编辑文本焦点

回答

0

在editText中使用android:enabled = true。使用RelativeLayout来创建视图并尽量不直接给出editText的高度。如果你这样做的清单中的属性android:windowSoftInputMode =“adjustResize”将工作。 如果您需要示例,请告诉我。

<RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 

     <LinearLayout 
      android:id="@+id/middle" 
      android:layout_width="10dip" 
      android:layout_height="fill_parent" 
      android:layout_centerVertical="true"> 
     </LinearLayout> 

     <EditText 
       android:layout_above="@id/middle" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent"> 
     </EditText> 

     <EditText 
       android:layout_below="@id/middle" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent"> 
     </EditText> 

    </RelativeLayout> 
+0

感谢您的快速帮助,可以请给我看一个例子,请大家帮忙 – Jes

+0

非常感谢您的努力 – Jes

+0

不客气。很高兴我能帮助你 – superM

1

您可以在滚动视图中添加您的布局,它会自动向上滚动,使edittext在键盘上。

0

使用editText2.requestFocus();将光标移至第二个EditText,并且EditText将自动向上移动。

+0

感谢您的快速帮助将尝试并让您知道结果。再次感谢 – Jes

相关问题