Wednesday, March 26, 2014

What level scrolling ListView


I read online that use HorizontalScrollView, I have used, but still is a vertical display, just playing android, and even hit, seek expert know
xml layout
android: layout_width = "wrap_content"
android: layout_height = "97dp"
>
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: orientation = "horizontal"
>


android: id = "@ + id / ziofthiscontent"
android: layout_width = "wrap_content"
android: layout_height = "97dp">



java code
ArrayList > content = new ArrayList > ();
for (int i = 0; i {
HashMap zi = new HashMap ();
zi.put ("zi", zi_content [i]);
content.add (zi);
}
SimpleAdapter adapter2 = new SimpleAdapter (WritechineseActivity.this, content, R.layout.content_zi, new String [] {"zi"}, new int [] {R.id.zi_button});
((ListView) findViewById (R.id.ziofthiscontent)) setAdapter (adapter2);.
private String [] zi_content = {"one", "two", "three", "four", "five", "six", "seven", "ten", "eleven", "twelve", " thirteen "," fourteen "," fifteen "," sixteen "," seventeen "};

R.layout.content_zi the xml layout




android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: orientation = "horizontal"
>

No comments:

Post a Comment