试了很多方法都无效,只有采用覆盖的方式,比如使用2个editText。后面无效的覆盖前面有效的,使之点击无效。
下面是实例:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="30sp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/editText"
android:layout_alignTop="@+id/editText"
android:focusable="false" />
</RelativeLayout>