A Simple Layout with two listViews.. 2
Here is the main.xml file.
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
| <?xml version= "1.0" encoding= "utf-8" ?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" android:orientation= "vertical" android:layout_width= "wrap_content" android:layout_height= "fill_parent" > <LinearLayout android:layout_width= "fill_parent" android:layout_height= "fill_parent" android:layout_marginLeft= "5dp" android:layout_marginRight= "5dp" android:layout_marginTop= "5dp" android:orientation= "horizontal" > <!-- this list contains products --> <ListView android:id= "@+id/list1" android:cacheColorHint= "#00000000" android:scrollbars= "none" android:fadingEdge= "vertical" android:soundEffectsEnabled= "true" android:dividerHeight= "1px" android:padding= "0dip" android:smoothScrollbar= "true" android:layout_width= "fill_parent" android:layout_height= "wrap_content" android:drawSelectorOnTop= "false" android:layout_marginTop= "5dip" android:layout_marginLeft= "5dip" android:layout_marginRight= "5dip" android:layout_marginBottom= "5dip" android:layout_weight= "1" /> <ListView android:id= "@+id/list2" android:layout_weight= "4" android:cacheColorHint= "#00000000" android:scrollbars= "none" android:fadingEdge= "vertical" android:soundEffectsEnabled= "true" android:dividerHeight= "1px" android:padding= "0dip" android:smoothScrollbar= "true" android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:drawSelectorOnTop= "false" android:layout_marginTop= "5dip" android:layout_marginLeft= "5dip" android:layout_marginRight= "5dip" android:layout_marginBottom= "5dip" /> </LinearLayout> </LinearLayout> |
Here is the layout for each row in the list .
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
| <? xml version = "1.0" encoding = "utf-8" ?> android:orientation = "vertical" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:padding = "7dp" > < TextView android:id = "@+id/item_title" android:layout_width = "fill_parent" android:layout_height = "wrap_content" android:padding = "2dp" android:text = "Main Item" android:textAppearance = "?android:attr/textAppearanceMedium" android:textSize = "14dp" android:textStyle = "normal" /> </ RelativeLayout > |
No comments:
Post a Comment