java - How to center a ImageView vertically in its parent? -


A TextView with the right long text and a visual image of my layout design Tekstwu. I ImageView want to center vertically his parents, so I've used Android: layout_centerVertical = "true", but it turned out that ImageView was tied under his original. If I do not use the layout_centerVertical property, then ImageView will be aligned at the top of its original. How can I solve this problem? Thank you.

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Relative layout Aksmelan: android = "Http://schemaskandroidkcom/apk/res/android" Android: Leaut_vind = "Fel_perent" Android: Leaut_heit = "wrap-content" android: background = "# 000000" & gt; Android: layout_alignParentRight = "true" android: background = "Android: Android: Android: Leaut_vidth =" wrap-content "Android: # Ff0000" android: layout_centerVertical = "true" Android: scaleType = "centerInside" / & gt; & Lt; TextView android: layout_width = "fill_parent" Android: layout_height = "wrap_content" android: text = "This is very very very very very very very very very very very very very very very long sentence" Android: TextColor = "# 23lACC" Android: Leaut_toleftof = "@ Id / t3" /> & Lt; / RelativeLayout & gt;    

Try android: layout_gravity = "center_vertical"


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -