SurfaceViewTemplate.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:decoy 作者:
public SurfaceViewTemplate(Context context, AttributeSet attrs) {
    super(context, attrs);

    mHolder = getHolder();
    mHolder.addCallback(this);

    // 设置Surface在Window(普通视图架构)之上
    setZOrderOnTop(true);
    // 设置色彩格式,半透明
    mHolder.setFormat(PixelFormat.TRANSLUCENT);

    // 设置可获得焦点
    setFocusable(true);
    setFocusableInTouchMode(true);

    // 设置保持屏幕亮
    this.setKeepScreenOn(true);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号