zoukankan      html  css  js  c++  java
  • android 5.0新特性学习--视图轮廓

    ViewOutlineProvider -- 视图轮廓
    setOutlineProvider--
    可以使用View.setClipToOutline方法去剪切一个视图的outline区域。
    只有rectangle,circle, 和round rectangle outlines支持裁剪(Outline.canClip方法用来判断是否可以裁剪)

    ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() {  
        //
        @Override  
        public void getOutline(View view, Outline outline) {  
            int size = getResources().getDimensionPixelSize(R.dimen.fab_size);  
            //将视图截成圆角矩形
            outline.setOval(0, 0, size, size);  
        }  
    };  
    //将轮廓提供者与待裁剪的view绑定
    fab.setOutlineProvider(viewOutlineProvider);
    int margin = Math.min(clippedView.getWidth(), clippedView.getHeight()) / 10;  
    Outline mClip = new Outline();  
    mClip.setRoundRect(margin, margin, clippedView.getWidth() - margin,  
            clippedView.getHeight() - margin, margin / 2);  
    /* Sets the Outline of the View. */  
    clippedView.setOutline(mClip);  
    /* Enables clipping on the View. */  
    clippedView.setClipToOutline(true);
  • 相关阅读:
    Windows的安全模型
    pefile解析PE格式
    在Linux下安装PyEmu
    Python的数据类型
    从pcap文件中分析出数据包
    Cuckoo架构
    Linux上调试python程序
    Linux关闭端口
    在Windows上安装部署Cuckoo
    分析由Python编写的大型项目(Volatility和Cuckoo)
  • 原文地址:https://www.cnblogs.com/androidsuperman/p/4199465.html
Copyright © 2011-2022 走看看