• 关于Android的资源id


    1 @+id/xx

    这个表示向资源文件中添加一个新的id。

    @+id是在R文件中生成int xxx=value。

    有两种情况

    ①R文件中不存在xxx变量,则生成int xxx=value即为控件新建一个id值

    ②若R文件中已存在xxx变量,则不再新建,直接引用该变量对应的id值

    2 @id/xxx

    引用现有的资源。

    例子:

    <TextView
    android:id="@+id/textView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/textView1" //请看这一行
    android:text="@string/textview2" />

    <TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/textview1" /> 

    2 @android:id/list

    只是在使用ListView的时候才规定要用@android:id/list

    <ListView
          android:id="@+id/list_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent" />
  • 相关阅读:
    socket通信原理
    socket通信基础内容
    内核中断过程
    爬虫基础模块
    关于多个运算符的问题
    前戏
    js扩展
    加密
    django之form
    Django
  • 原文地址:https://www.cnblogs.com/hustdc/p/11918513.html
Copyright © 2020-2023  润新知