To implement multiple ListView for a Viewpager take a look at this example: MainActivity.java public class MainActivity extends Activity { /** Called when the activity is first created. */ private Context mContext; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mContext = this; setContentView(R.layout.main); ListView listview1 = new ListView(mContext); ListView listview2 = new ListView(mContext); ListView listview3
Tag: listview
Android ListView With Rounded Corners
To make a ListView with rounded corners make a new xml file which will handle the rounded corners. “roundedlistview.xml” <?xml version=”1.0″ encoding=”UTF-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <gradient android:startColor=”#ffffff” android:endColor=”#000000″ android:angle=”270″/> <corners android:bottomRightRadius=”7dp” android:bottomLeftRadius=”7dp” android:topLeftRadius=”7dp” android:topRightRadius=”7dp”/> </shape> Now to call this you can
Android Listview With Rounded Corners
To create a listview with rounded corners create a shape in xml. Create roundedcorner.xml in the res/drawable <?xml version=”1.0″ encoding=”UTF-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle” > <gradient android:angle=”90″ android:endColor=”#C0C0C0″ android:startColor=”#808080″ /> <corners android:bottomLeftRadius=”7dp” android:bottomRightRadius=”7dp” android:topLeftRadius=”7dp” android:topRightRadius=”7dp” /> <stroke android:width=”1px” android:color=”#000000″ /> </shape> You can create a gradient, how much each corner radius should be and a stroke.