Android学习笔记(4):资源字典R.java

R.javaAndroid应用的资源文件

1. 每种资源在R类中是一个内部类

2. 每个资源是内部类里一个public static final int类型的变量

资源的使用:

1. 在Java代码中通过 R.资源对应的内部类的类名.资源项的名称 引用到该资源

2. 在XML文件中的访问格式为:@<资源对应的内部类的类名>/<资源项的名称>

当然在XML文件中可以用id访问:

1. 分配id@+id/<标识符代号>

2. 引用id@id/<标识符代号>

 

/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */
package android.support.v7.appcompat;
 
public final class R {
public static final class color {
public static final int abc_background_cache_hint_selector_material_dark = 0x7f0b0031;
}
public static final class dimen {
public static final int abc_action_bar_default_height_material = 0x7f080000;
}
public static final class drawable {
public static final int abc_ab_share_pack_holo_dark = 0x7f020000;
}
public static final class id {
public static final int action_bar = 0x7f0c0031;
}
public static final class integer {
public static final int abc_max_action_buttons = 0x7f090000;
}
public static final class layout {
public static final int abc_action_bar_title_item = 0x7f040000;
}
public static final class string {
public static final int abc_action_bar_home_description = 0x7f060000;
}
public static final class style {
public static final int Base_TextAppearance_AppCompat = 0x7f0a0027;
}
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值