Android: Common UI View Properties

Most likely you’ll only care about these:

  • Layout Width: FILL_PARENT or WRAP_CONTENT (required)
  • Layout Height: FILL_PARENT or WRAP_CONTENT (required)
  • Layout Weight: How greedy (0 default) or generous (1) a widget is.  0 (greedy,  myself first) or 1 (generous yield to everyone else)
  • Layout Gravity: How to align widget within parent
  • Gravity: How to align content of widget within itself
  • Id: Unique id of this widget, usually @+id/UNIQUEID (if you want to reference the View in Java code, this is required)
  • Text: Text for the content of the component, usually @string/TEXTIDNAME
Advertisements
This entry was posted in Android and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s