View andlayout

926
-1

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
926
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

View andlayout

  1. 1. UI Widget
  2. 2. Activity • Activity has Views or ViewGroups • ViewGroup has ViewGroups or Views • ViewGroup has ViewGroups or Views • recursive continue
  3. 3. Layout • View Widget • ViewGroup Layout • Layout res/layout XML • onCreate setContentView
  4. 4. View • TextView • EditText • ImageView • Button • ImageButton
  5. 5. ViewGroup • LinearLayout • TableLayout • Gallery • TabHost
  6. 6. URL • http://bit.ly/91DbG4 • http://bit.ly/8rBLYG • http://bit.ly/d5ieWu
  7. 7. View • • TextView Button • width fill parent wrap content • height wrap content fill parent
  8. 8. ( ) • View i/f • Button
  9. 9. Button • Button button = (Button)findViewById(R.id.button);
  10. 10. • Toast • setContentView setOnClickListener button.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Toast.makeText(ListenActivity.this, "button clicked", Toast.LENGTH_LONG).show(); }});
  11. 11. • • • • – Android
  12. 12. Dialog • • View
  13. 13. Dialog • AlertDialog • DatePickerDialog • ProgressDialog • TimePickerDialog • ZoomDialog
  14. 14. Dialog • AlertDialog • http://bit.ly/bghNAh
  15. 15. • Menu • onCreateOptionMenu • onPrepareOptionsMenu
  16. 16. • (http://db.tt/HNf3bu) •
  17. 17. • NotepadTutorial • http://bit.ly/c8jm70

×