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

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

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

問題描述

限時(shí)送ChatGPT賬號..

我有一個(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?

推薦答案

  1. 在 res/drawable/shape.xml 中創(chuàng)建一個(gè)矩形圓角形狀

  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>

  • 現(xiàn)在創(chuàng)建一個(gè)布局

  • 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>
    

  • 我已將線性布局背景設(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)!

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

    Cut, copy, paste in android(在android中剪切、復(fù)制、粘貼)
    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 位小數(shù)的數(shù)字)
    Changing where cursor starts in an expanded EditText(更改光標(biāo)在展開的 EditText 中的開始位置)
    EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
    主站蜘蛛池模板: 91精品国产综合久久久久久 | 日韩欧美一区二区三区 | a国产视频| 日本中文字幕一区 | www.99热| 日本不卡一二三 | 在线观看免费av网 | 欧美一区二区三区在线 | 中文字幕在线免费 | 在线观看亚洲精品 | 久久aⅴ乱码一区二区三区 亚洲欧美综合精品另类天天更新 | 亚洲毛片| 久草资源在线视频 | 日韩国产免费 | 亚洲国产成人精品女人久久久野战 | 国产精品久久久久久久久婷婷 | 国产精品一区二区三区在线 | a级在线免费视频 | 美女天天操 | 九九在线视频 | 日本亚洲精品成人欧美一区 | 日韩欧美视频免费在线观看 | 国产一区二区三区精品久久久 | 国产综合久久久久久鬼色 | 精品久久久一区二区 | 欧洲一级黄 | 欧美在线视频网 | 精品福利在线 | 国产在线观看一区二区三区 | 国产污视频在线 | 99riav国产一区二区三区 | 欧美日韩国产一区 | 亚洲性人人天天夜夜摸 | 99只有精品| 久久久久国产精品一区二区 | 一区二区三区精品视频 | 国产综合在线视频 | 超黄视频网站 | 草久久久| 午夜免费福利片 | 国产精品久久一区二区三区 |