2013-04-24 2 views
1

TabHost를 사용하여 다양한 탭을 사용하는 Android 앱을 개발 중입니다. 하나의 탭에는 동영상보기가 포함되어 있습니다. 나는 또한 상단에 이미지를 사용하고있다. 내 레이아웃은 :동영상보기 다른 레이아웃보다 전체 화면보기

|

- | 이미지 |

- | TabHost |

---- | LinearLayout |

---- | FrameLayout |

---- | TabWidget |

내 비디오를 전체 화면으로 보여주고 싶습니다. 일반 모드의 전체 화면을 전환하고 싶습니다. 비디오는 이미지 | 탭 및 전체 화면 모드에서 모든 보이는 영역을 포함해야합니다. `

,536 :이다
<?xml version="1.0" encoding="utf-8"?> 

<ImageView 
    android:id="@+id/btn_rating" 
    android:layout_width="177px" 
    android:layout_height="38px" 
    android:layout_marginBottom="6px" 
    android:layout_marginLeft="3px" 
    android:layout_marginTop="3px" 
    android:background="@drawable/rate_button" 
    android:contentDescription="@string/homeButton" /> 

<ImageView 
    android:id="@+id/titleImage" 
    android:layout_width="264px" 
    android:layout_height="42px" 
    android:layout_centerHorizontal="true" 
    android:contentDescription="@string/titleImage" /> 

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

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

     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="1" /> 

     <TabWidget 
      android:id="@android:id/tabs" 
      android:layout_width="match_parent" 
      android:layout_height="50px" 
      android:layout_marginBottom="-10px" 
      android:gravity="center" 
      android:paddingBottom="8px" /> 
    </LinearLayout> 
</TabHost> 

activity_video.xml

내 activity_main_screen.xml입니다

<FrameLayout 
    android:id="@+id/fragment_container" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_gravity="center" 
    tools:ignore="PxUsage" > 
</FrameLayout> 

`

및 Fragment_video_play.xml은 다음과 같습니다

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

에서는 전체 화면으로 비디오를 표시하는 날을 제안하세요?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <VideoView 
     android:id="@+id/VideoView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentTop="true" 
     android:layout_below="@id/buttonContainer"/> 
</RelativeLayout> 

을하지만 나는 비디오를 그리기 권하고 않을 것이다, 다음과 같이 사전에

덕분에

I 전체 화면 (화면 비율로 발생할 수있는 문제를 무시)를 채우기 위해 내 VideoView를 지켜 보면서있어 어떻게

답변

0

입니다 이는 다른 UI 요소 상단에 있습니다. 이는 앱의 성능을 저하시키는 오버 드로입니다.

+0

의견을 보내 주신 Joris에게 감사의 말씀을 전합니다. 그러나이 문제는 저에게 도움이되지 않았으므로 여전히 상단 이미지와 하단 탭 아래에 표시됩니다. 나는 그것들을 숨기거나 겹치기를 원한다. –

+0

새로운 활동을 시작하고 그 전체 화면을 만들어야 할 것 같습니다. 탭 상단에 그릴 수 있는지 잘 모르겠습니다 ... – Joris

관련 문제