如何在EditText中放置边框? [英] How to put a border in an EditText?
本文介绍了如何在EditText中放置边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以告诉我,如何在AndroidStudio中的editText中添加边框?
anybody could tell me, how to put a border in an editText in AndroidStudio?
例如editText中的正方形.
for example a square in an editText.
推荐答案
只需尝试一下,
首先在可绘制文件夹内创建一个XML文件(使用新的可绘制xml)并添加以下行
first create one XML file, inside drawable folder (use new drawable xml) and add this lines
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"/>
<solid android:color="#000000"/>
<stroke
android:color="#ffffff"
android:width="05dp"/>
<corners android:radius="20dp"/>
然后将此行添加到您的edittext属性中
then add this line inside Your edittext property
android:background="@drawable/(file_name)"
我不知道您的期望,也许对您有帮助
i don't know what your expecting, maybe it will help you
这篇关于如何在EditText中放置边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文