我有一个向量绘制的问题,我设置为我的RelativeLayout的背景。它不是水平填充屏幕。背景可绘制向量不填充屏幕
这里是我的RelativeLayout代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/my_drawable">
...
some text views etc.
...
</RelativeLayout>
和矢量绘制对象my_drawable,如果它有助于把它贴:
<vector android:height="24dp" android:viewportHeight="110.0"
android:viewportWidth="110.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:name="border_path" android:fillColor="@color/color_1" android:fillAlpha="1"
android:pathData="M105.13,107.51L4.89,107.51A2.38,2.38 99.69,0 1,2.51 105.13L2.51,4.89A2.38,2.38 119.37,0 1,4.89 2.51L105.13,2.51A2.38,2.38 119.37,0 1,107.51 4.89L107.51,105.13A2.38,2.38 99.69,0 1,105.13 107.51z"
android:strokeAlpha="1" android:strokeColor="@color/color_2" android:strokeWidth="5"/>
</vector>
任何建议/解决方案高度赞赏!一帧布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/sample"
android:text="Hello World!" />
</FrameLayout>
</RelativeLayout>
图像未加载 –