简体   繁体   中英

XML Layouts in android

He Everyone,

I want to create a screen with 4 panels vertically one after the other. First one contains notification icons bar , 2nd panel have list (which occupies half of the screen), 3rd one contains another notification bar and then 4th one fills the rest of the screen.

I want the notification bar should be of 10dip height and the rest of the 2 panels should cover remaining space in the device in equal manner.

I tried using Dip for the 1st three and fill_parent for the last panel. It doesn't look nice in all devices. How can i achieve this using XML code?

You should post your xml code from the layout so that we can see if theres any small error that can be fixed.

From what I can take from your question you are using fill_parent for the height of the remaining two panels? This will probably be the problem if that is the case. You could use the gravity and weight attributes to make the screens fit. For example the top screen you could put:

android:layout_weight="1"

and the second:

android:layout_gravity="bottom"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM