开发者

Android java how to make a edit text transparent but the text still visible?

开发者 https://www.devze.com 2023-04-08 10:23 出处:网络
How can i make a EditText box invisiable but the text still visiable <E开发者_运维知识库ditText android:layout_height=\"wrap_content\" android:visibility=\"invisible\" android:text=\"Testttttttttt

How can i make a EditText box invisiable but the text still visiable

<E开发者_运维知识库ditText android:layout_height="wrap_content" android:visibility="invisible" android:text="TestttttttttttttttttTTTTTTTTTTTTTTTTTTTTTTTT" android:layout_width="wrap_content" android:id="@+id/editText1" android:layout_above="@+id/trait1" android:layout_alignParentLeft="true" android:layout_marginBottom="78dp">
        <requestFocus></requestFocus>
    </EditText>

is my code but android:visibility="invisible" makes it all invisible


Instead of below code

android:visibility="invisible"

use this code

android:background="#00ffffff"


android:background="@null"

or

android:background="@android:color/transparent"


if you want to make a view semi-transparent then use this code

android:background="#80ffffff"


try it.. write it on onCreate();

EditText.setBackgroundColor(Color.TRANSPARENT);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号