2011-11-22 2 views
1

xml 파일에 이미지를 추가했습니다. 이것은 내가 사용하고있는 코드입니다 :Android 레이아웃 - 이미지가 추가 공간을 차지합니다

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 

    <ImageView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:src="@drawable/topbar_logo2x" 
     android:scaleType="fitStart" /> 

    <TabHost 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@android:id/tabhost" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" > 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:orientation="vertical" > 

      <View 
       android:layout_width="fill_parent" 
       android:layout_height="0.5dip" 
       android:background="#000" /> 

      <TabWidget 
       android:id="@android:id/tabs" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="0dip" 
       android:layout_marginRight="0dip" /> 

      <FrameLayout 
       android:id="@android:id/tabcontent" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" /> 
     </LinearLayout> 
    </TabHost> 
</LinearLayout> 

내 TabHost가 정확하게 내 이미지 위에 오길 원합니다. I에 유래 몇 가지 답변을 선택하면 Sndroid는 scaleType의 한 선언을 허용 할 것이다, 나는 내가 같은 이미지 뷰에 모두 android:scaleType="fitStart"android:scaleType="fitEnd"을 사용하고자하고 이렇게 할 수없는

android:scaleType="fitStart" 

을 사용하는 명시된 답변을 얻었다 . 코드의 변경으로 어떻게 동일한 결과를 얻을 수 있습니까? 저를 도울 다른 명령이 있습니까?

enter image description here

+0

그래서'TabHost'가'ImageView'보다 위에있게하고 싶습니까? Howabout은 XML에서'TabHost'를 위로 움직입니까? –

+0

아니요. Jarno 없음, 내 이미지가 페이지 (회사 로고) 상단에 있고 TabHost가 뒤에 붙음 – Vinoth

+0

Jarno가 없습니다. 내 이미지가 페이지 상단 (회사 로고)에오고 TabHost 뒤에는 – Vinoth

답변

2

는 큰 검은 선 이미지 (topbar_logo2x) 또는이 ImageView으로 조정되는 방식에서 와야 날 것으로 보인다. 위의 검은 선이 사라지는 지 확인하려면 scaleType="fitXY"을 사용해보십시오. 그렇지 않다면 우리가 볼 이미지를 게시하십시오.

View 이하는 LinearLayout이며, 검은 선이 작아집니다. 그것을 제거하십시오.

+1

답장을 보내 주셔서 감사합니다! 내가 원하는대로 효과가 있었다. – Vinoth

관련 문제