请告诉我,我怎样才能将文本放在这样的 EditText 中
并且只能编辑正确的文本。
将 TextView 和 EditText 保留在相对布局中,并根据您的要求进行调整。
例子:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<EditText
android:id="@+id/Edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:ems="10"
android:hint="To my first character" >
<requestFocus />
</EditText>
<TextView
android:id="@+id/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/Edittext"
android:layout_alignBottom="@+id/Edittext"
android:layout_alignParentRight="true"
android:text="123123" />
</RelativeLayout>
如果你有任何更改,请更改它
关于android - 将 TextView 放入 EditText,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15535323/
欢迎光临 OStack程序员社区-中国程序员成长平台 (http://ostack.cn/) | Powered by Discuz! X3.4 |