如何用这个边框制作
EditText
和用这个边框制作Button
。我找不到用可绘制的方法来做到这一点。我用 ImageView
来实现这个。但我不能使用 ImageView
来代替 EditText
。怎么才能做到这一点?
您可以将可绘制对象设置为视图的背景。假设您有用于该边框设计的可绘制对象,或者您可以从这个site生成它。
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text"
android:background="@drawable/custom_background"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button Text"
android:background="@drawable/custom_background"/>