<分区>
我正在 GitHub 上使用这个 AlhabetScroller
https://github.com/brightec/AlphabetScroller/blob/master/src/uk/co/brightec/alphabetscroller/AlphabetListAdapter.java
有文件 list_alphabet.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ListView
android:id="@android:id/list"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:fastScrollEnabled="true" />
<LinearLayout
android:id="@+id/sideIndex"
android:layout_width="40dip"
android:layout_height="fill_parent"
android:background="#FFF"
android:gravity="center_horizontal"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>
我的问题与这一行有关:
android:id="@android:id/list"
通常,我会这样做:
android:id="@+id/my_list"
正如他对 sideIndex 所做的那样。相反,他使用的似乎是 Android 代码中已经存在的东西。
这样做的目的是什么?为什么要这样做而不是我通常做的事情?
编辑:
感谢 Lalit Poptani。这个问题确实是重复的。