久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Android EditText 在其可繪制對象和文本之間繪制分隔

Android EditText draw a divider line between its drawable and its text(Android EditText 在其可繪制對象和文本之間繪制分隔線)
本文介紹了Android EditText 在其可繪制對象和文本之間繪制分隔線的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我有一個帶有 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:

我能想到的最簡單的方法是將這條線添加到我的可繪制圖像中.但是一般有沒有其他方法可以做到這一點?

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?

推薦答案

  1. 在 res/drawable/shape.xml 中創建一個矩形圓角形狀

  1. Create a rectangular rounded corner shape in res/drawable/shape.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="3dip" android:color="@android:color/darker_gray" />
<corners android:radius="10dip"/>
<padding android:left="10dip" android:top="10dip" android:right="10dip"        android:bottom="10dip" />
</shape>

  • 現在創建一個布局

  • Now create a layout

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/shape"
    android:gravity="center_vertical">
    
    
    <ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageView"
    android:src="@drawable/ic_launcher"/>
    
    <View
    android:layout_width="2dp"
    android:layout_height="match_parent"
    android:background="@android:color/darker_gray"
    android:layout_marginLeft="10dp"/>
    
    <EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/editText"
    android:layout_weight="1"
    android:background="@null"
    android:layout_marginLeft="10dp"
    android:hint="Your bitcoin address here"/>
    
    
    </LinearLayout>
    

  • 我已將線性布局背景設置為矩形圓角形狀.和urs的圖片預覽一模一樣.

  • I have set the Linear layout background with th rectangular rounded corner shape. It looks exactly as the image preview of urs.

    這篇關于Android EditText 在其可繪制對象和文本之間繪制分隔線的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

    【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!
  • 相關文檔推薦

    Cut, copy, paste in android(在android中剪切、復制、粘貼)
    android EditText blends into background(android EditText 融入背景)
    Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
    EditText showing numbers with 2 decimals at all times(EditText 始終顯示帶 2 位小數的數字)
    Changing where cursor starts in an expanded EditText(更改光標在展開的 EditText 中的開始位置)
    EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
    主站蜘蛛池模板: 国产小视频网站 | 国产精品日韩精品 | 黄色国产视频 | 欧美在线一区二区 | 欧美人与野 | 91禁蘑菇在线看 | 欧美日韩国产在线观看 | 成人女同在线观看 | 亚洲一区免费视频 | 天天爱天天色 | 成人羞羞网站 | 草草免费视频 | 激情网站在线观看 | 97精品在线视频 | 久久久国产一区二区三区 | 91久久久久久久 | 国产午夜精品一区二区三区视频 | 国产视频一区在线观看 | 九九99久久 | 国产精品毛片一区视频播 | 在线观看亚洲一区 | 一道本在线 | 中文字幕在线免费视频 | 奇米影视亚洲春色 | 91久久久久国产一区二区 | 黄色片在线 | 日韩在线不卡 | 日韩在线成人 | 最近中文字幕在线观看 | 日韩一级大片 | 九九视频在线免费观看 | 成人黄色录像 | 超碰在线免费公开 | 激情综合网站 | 黄色片中文字幕 | 亚洲精品视频在线观看免费 | 亚洲成人动漫在线观看 | 国产黄色精品视频 | 日日操天天操 | 国产小视频在线播放 | 日本免费在线观看 |