Android: widget align question -


in relativelayout have imageview serves background of widget , relativelayout. relativelayout "on" imageview, want in center of imageview. how can align it?

    <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="470px"     android:layout_height="120px"     android:layout_gravity="center_vertical"     android:gravity="center_vertical"     android:id="@+id/widgetlayout"     > <imageview android:id="@+id/imageview00"      android:layout_width="470px"      android:layout_height="120px"      android:scaletype="fitxy"      android:background="@android:color/transparent"       > </imageview>   <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="470px"     android:layout_height="120px"     android:layout_gravity="center"     android:gravity="center_horizontal|center_vertical"     android:id="@+id/widgetlayoutbelso"     > ... 

any ideas? thanks

set android:layout_centerinparent true on inner relative layout (you can remove gravity flags @ point).


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -