使用父母绘制资源 [英] Using parents for drawable resources

查看:108
本文介绍了使用父母绘制资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When I define a style, it can be inherited from a parent style, e.g:

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

现在我想用绘制资源做同样的,是这样的:

Now I want to do the same with drawable resources, something like this:

<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>

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

Is there a way to accomplish this functionality?

推荐答案

答案很简单 - 你不能延伸和覆盖可绘制。然而,

Short answer - you cannot extend and override drawables. However,

这篇关于使用父母绘制资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆