android sdk书写格式,Android以XML格式访问SDK属性(示例代码)

我正在尝试扩展Android的simple_list_item_2,所以我复制了它的XML,它是:

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:minHeight="?attr/listPreferredItemHeight"

android:mode="twoLine"

android:paddingStart="?attr/listPreferredItemPaddingStart"

android:paddingEnd="?attr/listPreferredItemPaddingEnd">

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_marginTop="8dp"

android:textAppearance="?attr/textAppearanceListItem" />

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_below="@id/text1"

android:layout_alignStart="@id/text1"

android:textAppearance="?attr/textAppearanceListItemSecondary" />

在我的实施中,问题是这条线

android:textAppearance="?attr/textAppearanceListItemSecondary"/>

给出错误:

Cannot resolve symbol ?attr/textAppearanceListItemSecondary

我试过像这样的东西:

android:textAppearance="android:?attr/textAppearanceListItemSecondary"

android:textAppearance="@android?attr/textAppearanceListItemSecondary"但它不起作用

所以我的问题是,如何访问Android SDK资源中的布局可以访问的相同符号/属性?我是否需要将符号复制到我的应用程序目录,或者我可以简单地访问simple_list_item_2所做的那个?

此外,原来的simple_list_item_2位于C:Androidsdkplatformsandroid-23dataeslayout,我的实施位于appsrcmaineslayout,如果它有帮助

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值