我正在製作一個應用程序,我希望從右到左填充gridview「使用它從右到左語言」,我試圖讓gridView重力設置爲正確但它沒有工作...我的gridview佈局如下。從右邊開始GridView元素
在此先感謝
<RelativeLayout
android:id="@+id/grid_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/show_info"
android:gravity="right" >
<GridView
android:id="@+id/channel_grid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:columnWidth="90dp"
android:gravity="right"
android:horizontalSpacing="10dp"
android:numColumns="auto_fit"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp" >
</GridView>
</RelativeLayout>
實際上,它從4.2開始考慮'layoutDirection'。我用一些額外的鏈接更新了我的答案。 – Jelle 2013-08-29 08:01:36
這是一個很好的提示,謝謝。在我的應用程序中,gridView具有固定數量的列,這樣我就可以模擬rtl方向。 – 2014-05-27 10:02:47