2015-09-13 61 views
0

我有下面顯示的圓圈動畫,它將由類圈動畫,它保持動畫在左上角,無論我做什麼,重力,中心佈局,沒有,請幫助我我真的卡在這裏,這裏是我的xml, 所以圓圈出現在屏幕的右上角,我希望它出現在動畫後屏幕的中心頂部,謝謝。居中動畫視圖在頂部中心的相對佈局

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 

xmlns:tools="http://schemas.android.com/tools" 

android:layout_width="match_parent" 

android:layout_height="match_parent" 
android:paddingLeft="@dimen/activity_horizontal_margin" 

android:paddingRight="@dimen/activity_horizontal_margin" 

android:paddingTop="@dimen/activity_vertical_margin" 

android:paddingBottom="@dimen/activity_vertical_margin" 

tools:context=".MainActivity"> 

<com.mynetwork.zaidkhaled.animation_test.circle 

    android:id="@+id/circle" 

    android:layout_width="300dp" 

    android:layout_height="300dp" 

    /> 

<Button 

    android:layout_width="wrap_content" 

    android:layout_height="wrap_content" 

    android:text=" animate" 

    android:id="@+id/animate" 

    android:textColor="#000000" 

    android:background="#ffffff" 

    android:layout_centerHorizontal="true" /> 

    </RelativeLayout> 

回答

0

把這些屬性的圈子小部件:

android:layout_alignParentTop="true" 
android:gravity="center" 

這給按鈕:

android:layout_below="@id/circle" 
+0

謝謝您的回答的人,但沒有工作還是畫在右上方:( –

+0

對不起imeant左上 –

+0

我不能在這裏發佈圖片 –