how to center a background image on Android app

Android when trying to set the background image is smaller than the terminal
Layout (XML file)

android: gravity = “center”
android: background = “@ drawable / bgfile”

But I was trying was not centered in any way troubled.

Do you know a little
“Android: layout_gravity”
Discover attribute.

android: layout_gravity = “center”
android: background = “@ drawable/corkboard02″

Why do I have been trying to see through.

“Android: gravity”
The view that describes the contents of the (child element) and specify a location for

“Android: layout_gravity”
Is to teach the parent element that describes the position of the view

I like to move.

カテゴリー: Android アプリ 関連 情報   パーマリンク