Semi-Transparent TextureViews not working

这一生的挚爱 提交于 2019-12-10 17:28:58

问题


I cannot change the transparency of a TextureView by setAlpha method to maske it semi-transparent as it is promised by the android SDK. For example mTextureView.setAlpha(0.5f) does not have any effect.


回答1:


You need to make sure and setOpaque(false).

From the docs:

public void setOpaque (boolean opaque) Added in API level 14

Indicates whether the content of this TextureView is opaque. The content is assumed to be opaque by default.




回答2:


The solution I used to make it happen was to wrap the TextureView in another widget like RelativeLayout and change the transparency of the parent.



来源:https://stackoverflow.com/questions/18993355/semi-transparent-textureviews-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!