Friday 15 August 2014

java - Android : ImageView overlapping -


I would like to have five ImageViews (ImageButtons) and I found this in a row, but when a small I'am Is my last image cropping up?

How can I fix this?

Is there a way to detect screen width?

| A. B C. D | E

In my RelativeLayout xml file:

  & lt; Android: layout_height = "wrap_content" android: layout_toEndOf = "@ + id / mFooterMembersImg" Android: layout_alignParentEnd = "true" android: background = "@: @ id =" @ + id / mFooterProfileImg "Android: layout_width =" wrap_content " drawable / icon_bar_profile "Android: contentDescription =" @ string / footer_img_profile "/ & gt; & Lt; ImageButton android: id = "@ id / mFooterMembersImg" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" Android: layout_toEndOf = "@ + id / mFooterCameraImg" android: background = "@ drawable / icon_bar_members" Android: ContentDescription = "@ String / footer_img_members" /> & Lt; ImageButton android: id = "@ id / mFooterCameraImg" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" Android: layout_toEndOf = "@ + id / mFooterMediaImg" android: background = "@ drawable / icon_bar_camera" Android: ContentDescription = "@ String / footer_img_camera" /> & Lt; ImageButton android: id = "@ id / mFooterMediaImg" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" Android: layout_toEndOf = "@ + id / mFooterHomeImg" android: background = "@ drawable / icon_bar_medias" Android: ContentDescription = "@ String / pastor_mog_media" /> & Lt; ImageButton android: id = "@ id / MFooterHomeImg" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" Android: layout_alignParentStart = "true" android: background = "@ drawable / icon_bar_home" Android: contentDescription = "@ string / Pastor_Mag_Home "/>  

I'm posting comments as answers Der Golem, just help in doing. To achieve your purpose, use the following code in your XML:

  & lt; LinearLayout Android: layout_width = "match_parent" Android: layout_height = "match_parent" & gt; & Lt; ImageButton android: id = "@ + id / mFooterProfileImg" Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" android: background = "@ drawable / icon_bar_profile" Android: contentDescription = "@ string / Parish_mug_profile "/> & Lt; ImageButton android: id = "@ id / MFooterMembersImg" Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" android: background = "@ drawable / icon_bar_members" Android: contentDescription = "@ string / Pastor_mag_imembers "/> & Lt; ImageButton android: id = "@ id / MFooterCameraImg" Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" android: background = "@ drawable / icon_bar_camera" Android: contentDescription = "@ string / Pastor_Mag_Camera "/> & Lt; ImageButton android: id = "@ id / MFooterMediaImg" Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" android: background = "@ drawable / icon_bar_medias" Android: contentDescription = "@ string / Pastor_mag_media "/> & Lt; ImageButton android: id = "@ id / MFooterHomeImg" Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" android: background = "@ drawable / icon_bar_home" Android: contentDescription = "@ string / Pastor_Mag_Home "/> & Lt; LinearLayout / & gt;  

Hope this can help you


No comments:

Post a Comment