gpt4 book ai didi

android - android中editText的自定义背景

转载 作者:太空狗 更新时间:2023-10-29 15:58:43 27 4
gpt4 key购买 nike

enter image description here

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFF"/>
<stroke
android:width="1.5dp"
android:color="#E53935"
/>

</shape>

我想为 editText 做这种类型的自定义设计。

最佳答案

试试这个:

enter image description here

Your custom file is perfect just you need to use it in background of edittext

<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#ffffff"
xmlns:android="http://schemas.android.com/apk/res/android">


<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="User name"
android:padding="15dp"
android:layout_margin="10dp"
android:background="@drawable/et_cust"/>

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:padding="15dp"
android:layout_marginTop="20dp"
android:layout_margin="10dp"
android:background="@drawable/et_cust"/>


</LinearLayout>

et_cust.xml

 <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<solid android:color="#FFFFFF"/>

<stroke
android:width="2dp"
android:color="#c9837f"/>

</shape>

关于android - android中editText的自定义背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49023249/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com