我在一个应用程序,需要我创建的Android窗口状背景样如何在Android中为XML创建一个类似于Window的背景?
工作,每个窗格表示可以按下一个Image
。
我想出了
,但我不知道如何设置网格。我在这里使用了TableLayout
&我希望我的每个TableRows
都具有这样的背景,看起来它形成了窗口的网格。
下面是使用我的TableLayout
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:topLeftRadius="30dp" android:topRightRadius="30dp"/>
<solid android:color="#FDFDFD"/>
<stroke android:color="#454545" android:width="1dp"/>
</shape>
请帮
我建议,如果你想编码是好的和容易然而将需要平滑滚动一个viewholder模式使用GridView控件。虽然如果你想要像滚动等方向的超级灵活性。使用回收视图,它会无论如何让你使用一个视图模式。 – Kushan
'RecyclerView'是否有网格? – Auro
RecyclerView支持横向和纵向滚动的Grids,Linear和StaggeredGrids – Kushan