Android 从圆上取下小部分
嗨,朋友们,请在这里帮忙,我试着做下面的形状超过三天,但不能得到它,我怎么能做到呢 但我得到的结果是这个 下面是我的代码 close_drawable.xmlAndroid 从圆上取下小部分,android,xml,android-layout,android-shape,android-shapedrawable,Android,Xml,Android Layout,Android Shape,Android Shapedrawable,嗨,朋友们,请在这里帮忙,我试着做下面的形状超过三天,但不能得到它,我怎么能做到呢 但我得到的结果是这个 下面是我的代码 close_drawable.xml <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="oval"> <solid andr
<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>
您的圆圈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
的布局中有填充,则可能会发生这种情况。很抱歉,我在上载时忘记将其设置为代码格式question@prominere你能添加你的整个布局吗?我已经用我最新的代码更新了我的代码,我已经尝试过了。请选中try File->invalidatecache&restart-?失效并重新启动。在这个干净的构建和重建项目之后。我复制了你的xml,它看起来像图片我认为你编辑了错误的img,因为ok和not ok看起来是一样的