0

朋友你好,请帮我在这里尝试做如下形状超过三天,但不能能得到它,我怎么能做到这一点从圆去除小部分

enter image description here

但输出我得到这是一个

enter image description here

下面是我的代码

close_drawable.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item> 
     <shape android:shape="oval"> 
      <solid android:color="#30000000"/> 
      <size android:height="70dp" android:width="70dp"/> 
     </shape> 
     <clip android:gravity="left" android:clipOrientation="horizontal"/> 
    </item> 
    <item android:drawable="@drawable/close" android:width="50dp" android:height="50dp" android:gravity="center"/> 

</layer-list> 

我的XML代码

<RelativeLayout 
     android:id="@+id/bottomroot" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_marginBottom="5dp" 
     android:gravity="center" 
     android:orientation="horizontal"> 

     <ImageView 
      android:id="@+id/nope" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      app:srcCompat="@drawable/close_drawable" /> 


     <ImageView 
      android:id="@+id/superlike" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
android:layout_marginLeft="-1.5dp" 
      android:layout_toRightOf="@+id/nope" 
      app:srcCompat="@drawable/superlike_drawable" /> 

     <ImageView 
      android:id="@+id/like" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="-1.5dp" 
      android:layout_toRightOf="@+id/superlike" 
      app:srcCompat="@drawable/like_drawable" /> 

     <ImageView 
      android:id="@+id/like_list" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="-1.5dp" 
      android:layout_toRightOf="@+id/like" 
      app:srcCompat="@drawable/likelist_drawable" /> 

     <TextView 
      android:id="@+id/textView2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignStart="@+id/superlike" 
      android:layout_alignEnd="@+id/superlike" 
      android:gravity="center" 
      android:layout_below="@+id/superlike" 
      android:text="Mashalla!" 
      android:textColor="#fff" /> 
    </RelativeLayout> 

enter image description here

+0

我认为你编辑了错误的img-既好又不好看起来一样 – X3Btel

回答

0

你的圈子XML建议立即进行删除这个样子:

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > 
<solid android:color="#20000000" /> 
<size 
    android:width="70dp" 
    android:height="70dp" /> 
</shape> 

编辑:如果你有在垫衬这可能发生布局,持有的ImageVIew

+0

对不起,我忘了在代码格式上传,而上传问题 – prominere

+0

@prominere你可以添加你的整个布局吗? – X3Btel

+0

我已经更新了我的代码和我最近的一个,我试过了,请检查 – prominere