السلام عليكم ....
انا مبتدأ في برمجة الاندرويد ولدي مشكلة بقالي 7 ايام ادور على النت حلها دون فائدة فأرجو من خبراء البرمجة مساعدتي....
.........................
انا اريد وضع مصفوفة نصية داخل gridView وتكون HorizontalScroll اي تمرير افقي ولما اجي اعملها تطلعلي كما في الصورة .... ارجو المساعدة رجاءً ....
كود xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" > <HorizontalScrollView android:id="@+id/horizontalScrollView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:fillViewport="true" android:scrollbars="horizontal" > <GridView android:layout_width="300dp" android:layout_height="400dp" android:id="@+id/gridView1" android:columnWidth="100dp" android:numColumns="8" android:horizontalSpacing="10dp" android:scrollbars="horizontal"> </GridView> </HorizontalScrollView> </RelativeLayout>
كود الجافا
GridView grid1=(GridView)findViewById(R.id.gridView1);
String[] myLiist={"111111","2222222","333333","444444","555555","6666666","7777777","888888","99999999","000000","12121212","13131313","1414141414","151515151515","171717171","111111","2222222","333333","444444","555555","6666666","7777777","888888","99999999","000000","12121212","13131313","1414141414","151515151515","171717171"};
ArrayAdapter<String> adp=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,myLiist);
grid1.setAdapter(adp); 
