Hello everyone,

I suspect that this can be a well known problem, if it's true, but I cannot 
find anything in this direction...I cannot only find a lot of topics on how 
to generally vertically align elements.

So, I have this layout part:

<LinearLayout
 android:orientation="horizontal"
 android:layout_width="match_parent"
 android:layout_marginTop="5dp"
 android:layout_gravity="center_vertical"
 android:gravity="center_vertical"
 android:layout_marginBottom="5dp"
 android:layout_height="35dp">
 <ImageView
 android:src="@drawable/mydrawablehere"
 android:layout_width="@dimen/mydimensionshere"
 android:layout_height="wrap_content" />
 <TextView
 android:id="@+id/rating"
 android:text="-/-"
 android:textSize="@dimen/mydimensionshere2"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content" />
</LinearLayout>



Now, when I run this code on an Android version >= 5.0, both the ImageView 
and the TextView are perfectly vertically centered (and the TextView is 
centered with respect to the image, too).
When I run this code on an Android version < 5.0, the TextView is almost at 
the same level of the top of the ImageView.

Can you please provide me any info about this problem, please?

Thanks in advance,
  Lorenzo

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/8114786f-2e35-4438-8c2d-d3b6eaa9a985%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to