Imitation iPhone UI uitableview for Android

Source: Internet
Author: User

Android-uitableview is a view that copies the iPhone UI, and the interface effect is good.

Defining Your Layout View Source code printing?
1 <br.com.dina.ui.widget.UITableView
2 android:id="@+id/tableView"
3 style="@style/UITableView"/>
Working on your activity view source code printing?
01 public
class
Example1Activity extendsActivity {
02 UITableView tableView;
03  
04 @Override
05 publicvoid
onCreate(Bundle savedInstanceState) {
06 super.onCreate(savedInstanceState);
07 setContentView(R.layout.main);
08 tableView = (UITableView) findViewById(R.id.tableView);
09 createList();
10 Log.d("Example1Activity","total items: "
+ tableView.getCount());
11 tableView.commit();
12 }
13  
14 privatevoid
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");
21 }
22  
23 privateclass
CustomClickListenerimplements
ClickListener {
24 @Override
25 publicvoid
onClick(intindex) {
26 Toast.makeText(Example1Activity.this,"item clicked: "
+ index, Toast.LENGTH_SHORT).show();
27 }
28 }
29 }

 

Source code:

Https://github.com/inmyfree/android-uitableview

Http://www.apkbus.com/android-95900-1-1.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.