簡體   English   中英

如何在android中設置TextInputEditText的右側和底部圖標

[英]How to set icon right side and bottom of TextInputEditText in android

如何在 android 中設置 TextInputEditText 的圖標右側和底部顯示圖像

你可以使用這個技巧

在此處輸入圖像描述

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_margin="5dp"
    android:layout_height="200dp">
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/outlinedTextField"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:hint="@string/label"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />

    </com.google.android.material.textfield.TextInputLayout>
    <ImageView
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:src="@drawable/ic_microphone"
        android:layout_alignParentEnd="true"
        android:layout_alignParentBottom="true"
        android:layout_margin="5dp"/>
</RelativeLayout>
  

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM