Android 按角度线划分的材质UI布局
我想实现下面的类似于ui的图像。布局被斜线一分为二。不知道如何实现它。任何帮助将不胜感激。没有从网络上得到任何提示Android 按角度线划分的材质UI布局,android,android-layout,material-design,Android,Android Layout,Material Design,我想实现下面的类似于ui的图像。布局被斜线一分为二。不知道如何实现它。任何帮助将不胜感激。没有从网络上得到任何提示 经过长时间的搜索,我终于找到了这个样本 项目的高度需要在XML中声明。在可绘制的代码段中添加XML Drawable-background.xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"
经过长时间的搜索,我终于找到了这个样本 项目的高度需要在XML中声明。在可绘制的代码段中添加XML Drawable-background.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorPrimary"/>
<item>
<bitmap android:src="@drawable/bebe" android:gravity="center" android:alpha="0.1"/>
</item>
<item android:top="300dp"
android:bottom="-300dp"
android:left="0dp"
android:right="-300dp">
<rotate
android:fromDegrees="-10"
android:pivotX="0%"
android:pivotY="100%">
<shape
android:shape="rectangle">
<solid android:color="?android:colorBackground"/>
</shape>
</rotate>
</item>
</layer-list>
用法:
<RelativeLayout
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="300dp"
android:background="@drawable/background" />
不是专家,但我相信它可能只是一个静态图像。@MKII不,我只是想知道如何用角度概念划分屏幕。已经在Yahoo News Digest应用程序中完成了。请看。我实际上正在研究这个问题,我想知道它是如何在Yahoo News Digest中实现的,我猜这是@MKII说的,他们在列表的左上方添加了一个三角形图像,并将其剪辑到视图中。不知道如何正确地实施它