0
我一直在使用listviews和數組,我正在努力的是我希望列表視圖的項目在右邊而不是左邊,左邊的滾動條 這裏是我的XML:更改列表視圖項的位置爲右
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="36dp"
android:background="#00688B"
android:cacheColorHint="#fff"
android:clickable="true"
android:fastScrollEnabled="false"
android:smoothScrollbar="true"
android:gravity="center_vertical" >
</ListView>
</LinearLayout>
的Java
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String[] captionArray = { "USA","India","England","Russia","Europe","Canada","Srilanka","Singapore","Thailand","Australia"};
ItemsAdapter ItemsAdapter = new ItemsAdapter(
Lister.this, R.layout.list,
captionArray);
setListAdapter(ItemsAdapter);
}