small medium large xlarge

06 Nov 2012, 13:05
khuong tran (1 post)

I tried the example on page 40-41 with the nested linearlayout and receive the warning “The LinearLayout layout or its parent is useless …” and it causes the word “Android Sudoku” not to be displayed in the center but left aligned to the button. Is there anyway to fix it? Thanks

06 Nov 2012, 13:33
Anthony Shaw (138 posts)

Post you XML so that we can see exactly where the problem is

13 Apr 2013, 21:23
Ed Burnette (1341 posts)

Doing a nested linear layout like that is a bit wasteful and later versions of the SDK do warn about it in the lint warnings. Making it more efficient (for example with a RelativeLayout) is left as an exercise for the reader.

This should not cause any alignment problem though. If the alignment is off check the way things are nested, and the values for margins and paddings.