首页 > 其他分享 >自定义view01 - 综述

自定义view01 - 综述

时间:2022-12-29 14:00:42浏览次数:43  
标签:自定义 综述 EdgeTransparentView styleable edge view01 position typedArray

TypedArray

  val typedArray: TypedArray =
            context.obtainStyledAttributes(attrs, R.styleable.EdgeTransparentView)
        position = typedArray.getInt(R.styleable.EdgeTransparentView_edge_position, 0)
        drawSize = typedArray.getDimension(
            R.styleable.EdgeTransparentView_edge_width,
            20
        )
        typedArray.recycle()
<resources>
    <declare-styleable name="EdgeTransparentView">
        <attr name="edge_position">
            <flag name="top" value="0x01"/>
            <flag name="bottom" value="0x02"/>
            <flag name="left" value="0x04"/>
            <flag name="right" value="0x08"/>
        </attr>
        <attr name="edge_width" format="dimension"/>
    </declare-styleable>
</resources>

标签:自定义,综述,EdgeTransparentView,styleable,edge,view01,position,typedArray
From: https://www.cnblogs.com/loaf/p/zi-ding-yiview01--zong-shu.html

相关文章