仿制Iphone UI的UITableView for Android
jopen
11年前
android-uitableview是一个仿制Iphone UI的view,界面效果不错。
Defining your layout
<br.com.dina.ui.widget.UITableView android:id="@+id/tableView" style="@style/UITableView" />
Working on your activity
public class Example1Activity extends Activity { UITableView tableView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tableView = (UITableView) findViewById(R.id.tableView); createList(); Log.d("Example1Activity", "total items: " + tableView.getCount()); tableView.commit(); } private void createList() { CustomClickListener listener = new CustomClickListener(); tableView.setClickListener(listener); tableView.addItem("Example 1", "Summary text 1"); tableView.addItem("Example 2", "Summary text 2"); tableView.addItem("Example 3", "Summary text 3"); tableView.addItem("Example 4", "Summary text 4"); } private class CustomClickListener implements ClickListener { @Override public void onClick(int index) { Toast.makeText(Example1Activity.this, "item clicked: " + index, Toast.LENGTH_SHORT).show(); } } }