【问题标题】:Using parents for drawable resources使用父级获取可绘制资源
【发布时间】:2012-10-06 10:02:10
【问题描述】:

当我定义一个样式时,它可以从父样式继承,例如:

<style name="DialogNoTitle" parent="@android:style/Theme.Dialog">
    <item name="android:windowNoTitle">true</item>
</style>

现在我想对可绘制资源做同样的事情,如下所示:

<shape xmlns:android="http://schemas.android.com/apk/res/android" name="ChildDrawable" parent="@drawable/ParentDrawable">
    <solid android:color="@android:color/white"/>
    <corners android:radius="6dp"/>
</shape>

有没有办法实现这个功能?

【问题讨论】:

  • 子drawable究竟会从父drawable继承什么?
  • 一切,然后我决定重写什么,就像样式中的继承一样。

标签: android styles drawable


【解决方案1】:

简短回答 - 您不能扩展和覆盖可绘制对象。不过,

【讨论】:

    猜你喜欢
    • 2014-04-25
    • 2012-04-05
    • 2020-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多