我创建了一个带有属性的自定义视图。有没有办法在 Android studio 中通过 android 工具使用这些属性?
例如 :
<MyOwnCoolView
android:layout_width="96dp"
android:layout_height="96dp"
android:padding="3dp"
tools:dividerAngle="2"/>
attr 文件所在位置:
<resources>
<declare-styleable name="MyOwnCoolView">
<attr name="dividerAngle" format="float"/>
</declare-styleable>
我的意见是你不能。
不过还是有官方的very旧, 页here http://tools.android.com/tips/layout-designtime-attributes引用:
设计时属性只能用于框架资源,不能用于
此时自定义属性。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)