android-uitableview是一个仿制Iphone UI的view,界面效果不错。
Defining your layout
1 | < br.com.dina.ui.widget.UITableView |
2 |
android:id = "@+id/tableView" |
3 |
style = "@style/UITableView" /> |
Working on your activity
01 | public class Example1Activity extends Activity { |
05 |
public void onCreate(Bundle savedInstanceState) { |
06 |
super .onCreate(savedInstanceState); |
07 |
setContentView(R.layout.main); |
08 |
tableView = (UITableView) findViewById(R.id.tableView); |
10 |
Log.d( "Example1Activity" , "total items: " + tableView.getCount()); |
14 |
private void createList() { |
15 |
CustomClickListener listener = new CustomClickListener(); |
16 |
tableView.setClickListener(listener); |
17 |
tableView.addItem( "Example 1" , "Summary text 1" ); |
18 |
tableView.addItem( "Example 2" , "Summary text 2" ); |
19 |
tableView.addItem( "Example 3" , "Summary text 3" ); |
20 |
tableView.addItem( "Example 4" , "Summary text 4" ); |
23 |
private class CustomClickListener implements ClickListener { |
25 |
public void onClick( int index) { |
26 |
Toast.makeText(Example1Activity. this , "item clicked: " + index, Toast.LENGTH_SHORT).show(); |
![](https://img-blog.csdn.net/20130607162620703)
![](https://img-blog.csdn.net/20130607162454640)
![](https://img-blog.csdn.net/20130607162632343)
源码:
https://github.com/inmyfree/android-uitableview
http://www.apkbus.com/android-95900-1-1.html