1

RelativeLayout의 배경으로 설정 한 벡터 드로어 블에 문제가 있습니다. 화면을 가로로 채우지 못합니다.배경 드로잉 벡터가 화면을 채우지 못함

<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> 

그리고 아래의 스크린 샷을 : 그것은 게시하는 데 도움이 경우,

<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 : 여기

내 RelativeLayout의 코드입니다. 보시다시피 전체 너비가 채워지지 않습니다. enter image description here

모든 제안/해결책을 높이 평가했습니다. 일부 패딩을 포함에서 프레임 레이아웃

<?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> 

output

+0

이미지가로드되지 않습니다. –

답변

0

장소 이미지보기 원본 이미지처럼 생성 된 벡터 드로어 블을 찾습니다. 그것을 제거하고 drawable을 다시 재생하십시오.

+0

같은 문제는 변경되지 않았습니다. – MMagician

0

내부

+0

노력했지만, 패딩이없는 것 같습니다. pathData의 위치를 ​​살펴본 결과 뷰포트의 특성에 따라 지정된 모서리에 도달하는 것처럼 보입니다 (여기서는 간단한 논리로 벡터 그래픽 전문가가 아니며 잘못되었을 수도 있음). – MMagician

0

나는 이것이 내가 찾던 해결책이 아니라 벡터로 노는 것이 아니라 단순히 드로어 블 XML을 만들었다 고 알고있다. 내 목표는 그림자를 구현하는 것이 었으므로 SVG 가져 오기부터 시작했지만 그림자 목록을 사용하여 그림자를 얻을 수있었습니다.

해결책을 찾지 못한 사람이 누구인지 궁금 할 것입니다.

감사합니다.