嗯.. @ Shalini的答案以这种方式帮助我,但是我仍然有另一种方式来实现2D影子与EditText Field,我将与大家分享.
We need to create custom XML view with three layer for EditText,
bottom shadow and right side shadow
以下是我的代码
RES /抽拉/ edittext_shadow.xml
现在我们可以使用“Background”属性将这个阴影视图设置为TextField
喜欢这个
RES /布局/ main.xml中
android:id="@+id/txtpin"
android:maxLength="4"
android:layout_height="37dp"
android:gravity="center_horizontal"
android:longClickable="false"
android:padding="2dp"
android:inputType="textPassword|number"
android:password="true"
android:background="@drawable/edittext_shadow"
android:layout_weight="0.98"
android:layout_marginLeft="15dp">
结果屏幕就像我上面发布的问题.
感谢SO,分享知识.