2017-11-22 3 views
1

배경을 LinearLayout으로 설정하고 싶습니다. 참조 번호는 this입니다. 그러나 여전히 4면에 공간을 남겼습니다. 스크린 샷 screenshot이미지가 타블렛의 전체 화면에 맞지 않습니다.

코드 일부 솔루션 (있는 경우)를주십시오 다음

<FrameLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <ImageView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@mipmap/background" 
     android:scaleType="fitXY" /> 
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="horizontal"> 
<someviews></someviews> 
</LinearLayout> 
</FrameLayout> 

입니다.

+1

세트 ** 안드로이드 님의 배경 = "@ 밉맵/배경"** 이미지 ** lineerLayout ** – Prem

답변

0
  • 대신 사용 android:backgroundandroid:src.
  • android:adjustViewBounds="true"

이 이미지 뷰의 내용으로 그릴 수를 설정 추가합니다.

마지막

<ImageView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:src="@mipmap/background" 
     android:scaleType="fitXY" 
     android:adjustViewBounds="true" /> 
+0

당신의 도움에 감사드립니다. 하지만 여전히 동일한 출력을 내고 있습니다. –

+0

@KiranS 이미지가 너무 작습니다. –

+0

@KiranS는 MIPMAP 대신 DRAWABLE 폴더에서 이미지를 호출합니다. –

0
<resources> 

<dimen name="activity_horizontal_margin">0dp</dimen> 
<dimen name="activity_vertical_margin">0dp</dimen> 
</resources> 

체크 dimen.xml 파일을 넣어 0dp 수평 및 수직 마진

관련 문제