gpt4 book ai didi

android - 在 drawable xml 中应用样式资源

转载 作者:行者123 更新时间:2023-11-29 14:00:49 24 4
gpt4 key购买 nike

我在 res/values/styles.xml 中有这个

    <style name="ListViewRowBorder" >
<item name="android:width">1dp</item>
<item name="android:color">@color/listview_row_stroke_color</item>
</style>

我能够访问颜色资源。如何在 res/drawable/file.xml 中访问此样式资源(如下所示)我在下面尝试的方法似乎不起作用。

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/list_item_dark_background"/>
<stroke style="@style/ListViewRowBorder" />
</shape>
</item>

最佳答案

关于android - 在 drawable xml 中应用样式资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9563330/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com