2015-08-26 41 views
1

以下圖片是我迄今取得的成果。但是,我想按比例將我的按鈕對齊到半個圓圈。你能幫我解決嗎?如何按比例將我的按鈕與半個ImageView對齊?

enter image description here

這裏是我的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" 
    tools:context=".MainActivity" 
    android:orientation="horizontal"> 



    <ImageView 
     android:id="@+id/halfcircle" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/halfcircle" 
     android:layout_centerVertical="true" /> 

    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     android:layout_centerVertical="true" 
     android:layout_toRightOf="@+id/halfcircle"> 

     <LinearLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal" 
      android:layout_marginBottom="30dp" 
      android:background="@color/red" 
      android:padding="10dp"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Button 1"/> 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal" 
      android:layout_marginBottom="30dp" 
      android:layout_marginLeft="10dp" 
      android:background="@color/red" 
      android:padding="10dp"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Button 1"/> 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal" 
      android:layout_marginBottom="30dp" 
      android:layout_marginLeft="10dp" 
      android:background="@color/red" 
      android:padding="10dp"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Button 1"/> 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal" 
      android:layout_marginBottom="30dp" 
      android:layout_marginLeft="10dp" 
      android:background="@color/red" 
      android:padding="10dp"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Button 1"/> 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal" 
      android:layout_marginBottom="30dp" 
      android:background="@color/red" 
      android:padding="10dp"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Button 1"/> 
     </LinearLayout> 



    </LinearLayout> 



</RelativeLayout> 
+0

你的意思是圓圈,在圓圈按鈕包圍形狀 – Anil

+0

[動態排列圓周上的某些元素]的可能重複(http://stackoverflow.com/questions/10152390/dynamically-arrange-some-elements-around-a-circle) –

+0

是,@Anil。我希望我的按鈕環繞半圈。 –

回答