请教 android怎么让控件背景透明呢? 如题,让EditText控件的背景透明. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 设置背景颜色 setBackgroundColor(0x80000000),0x80000000根据自己要求换 记得Color里有个 Color.TRANSPARENT 就是透明 <EditTextandroid:text="This is TextView,you can input anything you want" android:id="@+id/text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="16sp" android:padding="10dip" android:background="#cc0000"应该把这里的颜色改成0x80000000 就ok了 ></EditText>我还看到可以在java代码里面实现透明的功能! 比如TextView <TextView android:text="This is TextView,you can input anything you want" android:id="@+id/text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="16sp" android:padding="10dip" android:background="@drawable/Translucent"这儿可以用drawable定义颜色常数! ></TextView> 定义一个drawable <drawable name=color_name>0xe0000000/>在xml中<Textview android:textcolor="@drawable/colorname"/> 其他的你自己加颜色和不透明度 (alpha) 值以十六进制表示法表示。任何一种颜色的值范围都是 0 到 255(00 到 ff)。对于 alpha,00 表示完全透明,ff 表示完全不透明。表达式顺序是“aabbggrr”,其中“aa=alpha”(00 到 ff);“bb=blue”(00 到 ff);“gg=green”(00 到 ff);“rr=red”(00 到 ff)。例如,如果您希望对某叠加层应用不透明度为 50% 的蓝色,则应指定以下值:7fff0000 android:background="#00000000" 直接这样就行! findViewById(R.id.image_item).getBackground().setAlpha(100); 项目中使用到的,无下划线效果。Android使用TextView实现无下划线超链接 如何让自己注册的BroadcastReceiver可以一直监听 新手求教一个顶部导航的问题 大家好,我用ListView设置界面为主页,在ListView的item的子页如何返回主页 android频闪如何实现,需要和歌曲同步,做过的来。没做的可以讨论。 服务器交互 android如何将数据库打包到apk里面 用android自动浏览器,不用运行window.showModalDialog surfaceview全屏问题 求助,关于微信朋友圈状态回复列表的布局问题 毕设求指点 安卓横竖屏切换抖动 textview控件显示位置的设定
android:text="This is TextView,you can input anything you want"
android:id="@+id/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:padding="10dip"
android:background="#cc0000"应该把这里的颜色改成0x80000000 就ok了
>
</EditText>我还看到可以在java代码里面实现透明的功能!
android:text="This is TextView,you can input anything you want"
android:id="@+id/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:padding="10dip"
android:background="@drawable/Translucent"这儿可以用drawable定义颜色常数! >
</TextView>
<drawable name=color_name>0xe0000000/>
在xml中
<Textview android:textcolor="@drawable/colorname"/> 其他的你自己加颜色和不透明度 (alpha) 值以十六进制表示法表示。任何一种颜色的值范围都是 0 到 255(00 到 ff)。对于 alpha,00 表示完全透明,ff 表示完全不透明。表达式顺序是“aabbggrr”,其中“aa=alpha”(00 到 ff);“bb=blue”(00 到 ff);“gg=green”(00 到 ff);“rr=red”(00 到 ff)。例如,如果您希望对某叠加层应用不透明度为 50% 的蓝色,则应指定以下值:7fff0000