2013-11-23 3 views
0

나는이 파일 레이아웃 폴더와 레이아웃 랜드 폴더를이 xml 파일에 넣어서 xml 파일을 가지고 있습니다. 이미지보기를 포함하여 framelayout을 사용했지만 응용 프로그램 이미지를 실행하면 표시되지 않습니다. 이미지가 표시되지 않는 이유를 말해주십시오. 이미지가 표시되지 않습니다

은 내가 XML 파일

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

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="60dp" 
     android:background="@color/header" 
     android:orientation="horizontal" 
     android:weightSum="3" > 

     <ImageView 
      android:id="@+id/imageView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:background="@drawable/navigation" /> 

     <TextView 
      android:id="@+id/textView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:layout_marginLeft="2dp" 
      android:text="Kesari" 
      android:textColor="@color/textcolor" 
      android:textSize="14sp" /> 

     <TextView 
      android:id="@+id/textView2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:layout_marginLeft="5dp" 
      android:layout_weight="2" 
      android:text="Choose from the exciting holiday packages across 7 continents from world class travel company" 
      android:textColor="@color/textcolor" 
      android:textSize="14sp" /> 
    </LinearLayout> 

    <TabHost 
     android:id="@android:id/tabhost" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

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

     <HorizontalScrollView 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:fillViewport="true" 
       android:scrollbars="none"> 

      <TabWidget 
        android:id="@android:id/tabs" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" > 
      </TabWidget> 

     </HorizontalScrollView> 

     <FrameLayout 
       android:id="@android:id/tabcontent" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" > 

      <RelativeLayout 
       android:id="@+id/tab1" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" > 

       <LinearLayout 
        android:id="@+id/linearLayout1" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_alignParentLeft="true" 
        android:layout_alignParentTop="true" 
        android:layout_marginLeft="20dp" 
        android:orientation="vertical" > 
       </LinearLayout> 

       <RelativeLayout 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerVertical="true" 
        android:layout_toLeftOf="@+id/linearLayout1" > 
       </RelativeLayout> 
      </RelativeLayout> 

      <RelativeLayout 
        android:id="@+id/tab2" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" > 
      </RelativeLayout> 

      <RelativeLayout 
        android:id="@+id/tab3" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" > 
      </RelativeLayout> 

      <RelativeLayout 
        android:id="@+id/tab4" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" > 
      </RelativeLayout> 

      <RelativeLayout 
        android:id="@+id/tab5" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" > 
      </RelativeLayout> 

      <RelativeLayout 
        android:id="@+id/tab6" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" > 
      </RelativeLayout> 

      <RelativeLayout 
        android:id="@+id/tab7" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" > 
      </RelativeLayout> 
     </FrameLayout> 
    </LinearLayout> 
</TabHost> 

<FrameLayout 
    android:id="@+id/framelayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <ImageView 
     android:id="@+id/ImageView01" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@drawable/malaysia1"></ImageView> 

</FrameLayout> 


</LinearLayout> 
+0

이미지를 탭 호스트 또는 framelayout에 표시하려고합니다. framelayout에서 이미지를로드하려면 조각을 사용하고 이미지를로드해야합니다. –

+0

tahhost 아래에 tahhost 아래에 이미지를 표시해야합니다. 빈 영역이 있습니다. 이미지를 배경으로 설정하고 싶습니다. – user2982189

+0

그 다음 간단하게 조각을 사용하여 framelayout에 이미지를로드하십시오 –

답변

0

당신이 wrap_contentmatch_parent .Replace로 tabHost에 높이를 부여하고 imageView 또한 높이 wrap_content을 사용했기 때문에이 있어야합니다의 전체 소스 코드를 부착.

+0

@Manishika ..... good..you are – Piyush

관련 문제