Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - [XML-Layouts] - Useful Snippets

[XML-Layouts] - Useful Snippets

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

[XML-Layouts] - Useful Snippets

Postby plusminus » Mon Dec 17, 2007 8:24 pm

[align=center]Useful XML-Layouting Snippets[/align]

[hr][hr]
Centering Views within its parent:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. android:gravity="center_horizontal"
Parsed in 0.000 seconds, using GeSHi 1.0.8.4
Java equivalent:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. setGravity(Gravity.CENTER_VERTICAL);
Parsed in 0.014 seconds, using GeSHi 1.0.8.4

Remember the difference between:
Code: Select all
* android:gravity will center the text within the TextView.
* android:layout_gravity will center the TextView within its parent.


For more info see:
http://code.google.com/android/referenc ... id:gravity[hr][hr]

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 5 guests