我有一個MapFragment類,在調用它時會佔用整個屏幕。僅將橫向模式設置爲安卓Google地圖片段
從this question,我知道強制水平佈局需要更改Android Manifest。但是,如果它適用於MapFragment類,該如何實現呢?
這是我爲我的地圖顯示XML,如果它可以幫助:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<fragment
android:id="@+id/fragment_map"
android:name=".com.fragments.MapFragment"
class="com.fragments.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:tag="tag_fragment_map" />
</FrameLayout>
感謝您給我們!似乎有助於解決我的問題! =) – lyk 2013-02-11 07:59:22
嗨,對不起,我剛剛意識到,一旦我做了.replace()將mapfragment更改爲另一個片段,那麼橫向位置仍然存在...是否有方法將其恢復正常? – lyk 2013-02-11 08:32:32
當然,我會更新答案 – Geros 2013-02-11 08:41:07