В настоящее время я работаю с изображением, чтобы отобразить векторную графику. Который он не будет отображать, но он отображает значок в androidstudio на левой стороне. Код можно увидеть ниже:
EDIT
Я установил вес на 0, чтобы отобразить его в конце линейного макета. Это не ошибка ширины или высоты.
Расположение не является проблемой, отображение
Как видите, вектор действителен с левой стороны.
Код всплывающего окна:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/report_template_edit_draft_popup"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/pspdf__color_white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@string/report_template_popup_window_title"
android:textStyle="bold" />
<ImageView
android:id="@+id/report_template_popup_close_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0"
android:minHeight="30dp"
android:minWidth="30dp"
app:srcCompat="@drawable/ic_close" />
</LinearLayout>
</LinearLayout>
Проблема в том, что он не отображается в дизайне, а не в приложении.
И да, я использую это в своем build.gradle
vectorDrawables.useSupportLibrary true
ic_close.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#ffffff"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>