请问android中如何设置透明,使得能背景没有,就是能够直接看到图片,让字相当于悬浮在背景之上的效果,或者是能通过css之类的来实现么?
1条回答 默认 最新
suziwen 2010-03-29 23:51关注[quote]To achieve transparency both the view's background drawable, which is inherited, and the WebView's backgroundColor variable must be assigned values of 0. The first may be accomplished through either a call to setBackgroundDrawable(), or the android:background tag in the xml. The second is set by calling setBackgroundColor().[/quote]
[quote]As always you tend to figure these things out as soon as you ask the question. For the benefit of others, the layout that I'm using, LinearLayout, can take a background parameter that can be a colour or a resource.
So in my views .xml file I simply added a
android:background="@+drawable/backgroundmain"
and useweb.setBackgroundColor(0);
To make the webview transparent to see the background image behind.[/quote]本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报