1
我想分割屏幕的2個區域,左邊的ImageView
和右邊的ScrolView
。我加入了ImageView
和滾動型編程的內容,因此佈局的XML文件看起來像這樣:Android與FrameLayout和ScrollView的佈局問題
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<FrameLayout
android:id="@+id/scene_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left"
>
</FrameLayout>
<ScrollView
android:layout_height="fill_parent"
android:layout_width="@dimen/scrollmenu_width"
android:layout_gravity="right"
>
<LinearLayout
android:id="@+id/scrollmenu"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_width="fill_parent"
>
</LinearLayout>
</ScrollView>
</FrameLayout>
我在做什麼錯?因爲我將ScrollView
置於右側,但ImageView
居中(相對於屏幕)放置在屏幕左側。該圖像的分辨率超過了屏幕的分辨率,所以我得到黑色sp
啊啊啊,我知道這是可能的,只是我是新來的Android,並沒有過我的腦海在這種情況下。謝謝你,解決方案的工作,雖然這不是你寫'LinearLayout'的重量參數的方式 – Romeo 2012-01-01 15:11:33
對不起,我很高興能夠提供幫助。 – 2012-01-01 15:14:58
已經接受:)這是我正在尋找的解決方案 – Romeo 2012-01-01 15:16:01