正在加载图片...
Customize List View <TextView In case you don't want to use android:layout_width="wrap_content" android:layout_height="wrap_content" one of the pre-defined layouts android:layout_marginBottom="20sp" android:gravity="center_horizontal" your own layout must have an android:text="This is Tom's list view" android:textColor="#f00" element with the id android:textSize="30sp"/> "@android:id/list"which is the <ListView ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="50dp"/> In activity java file,still use the method setContentview() protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentview (R.layout.activity main); 10 Customize List View • In case you don't want to use one of the pre-defined layouts your own layout must have an element with the id "@android:id/list" which is the ListView • In activity java file, still use the method setContentView() 10 <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="20sp" android:gravity="center_horizontal" android:text="This is Tom's list view" android:textColor="#f00" android:textSize="30sp" /> <ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="50dp"/> protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有