問題描述
我有一個(gè)帶有 drawableLeft
圖像的 EditText
.我需要在我的 drawableLeft
旁邊的 EditText
中添加一條垂直線,如下例所示:
I have an EditText
with a drawableLeft
image. I need to add a vertical line in EditText
right beside my drawableLeft
like this example:
我能想到的最簡單的方法是將這條線添加到我的可繪制圖像中.但是一般有沒有其他方法可以做到這一點(diǎn)?
Easiest way that I can think of is to add that line into my drawable image. But generally is there any other way to do this?
推薦答案
在 res/drawable/shape.xml 中創(chuàng)建一個(gè)矩形圓角形狀
Create a rectangular rounded corner shape in res/drawable/shape.xml
現(xiàn)在創(chuàng)建一個(gè)布局
Now create a layout
我已將線性布局背景設(shè)置為矩形圓角形狀.和urs的圖片預(yù)覽一模一樣.
I have set the Linear layout background with th rectangular rounded corner shape. It looks exactly as the image preview of urs.
這篇關(guān)于Android EditText 在其可繪制對象和文本之間繪制分隔線的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!