问题描述
|
即使使用滚动视图,我也无法在滚动视图中进行滚动。
请帮我。请在下面找到我的布局。
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<LinearLayout android:id=\"@+id/LinearLayout01\"
android:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"
xmlns:android=\"http://schemas.android.com/apk/res/android\">
<ScrollView android:layout_width=\"fill_parent\" android:fillViewport=\"true\"
android:layout_height=\"fill_parent\">
<RelativeLayout android:id=\"@+id/relativeLayout1\"
android:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\">
<TextView android:id=\"@+id/screen_title\" style=\"@style/window_title\"
android:text=\"@string/music_title\" />
<LinearLayout style=\"@style/linear_hor_style\"
android:id=\"@+id/albumLayout\" android:layout_below=\"@+id/screen_title\">
<ImageView android:layout_width=\"100sp\"
android:layout_height=\"100sp\" android:src=\"@drawable/no_album\"
android:padding=\"5sp\" android:id=\"@+id/albumImage\"></ImageView>
<TextView android:layout_width=\"match_parent\" android:hint=\"Album Text Comes Here\"
android:padding=\"5sp\" android:gravity=\"center_vertical\"
android:layout_height=\"match_parent\" android:id=\"@+id/albumText\"></TextView>
</LinearLayout>
<ProgressBar android:id=\"@+id/progressBar1\"
android:paddingTop=\"10sp\" style=\"@android:style/Widget.ProgressBar.Horizontal\"
android:layout_below=\"@+id/albumLayout\" android:layout_width=\"fill_parent\"
android:layout_height=\"wrap_content\"></ProgressBar>
<TextView android:id=\"@+id/elapsedtime\"
android:layout_width=\"wrap_content\" android:text=\"00:00:00\"
android:layout_height=\"wrap_content\" android:layout_below=\"@+id/progressBar1\"
android:paddingLeft=\"5sp\" android:layout_alignParentLeft=\"true\"></TextView>
<TextView android:id=\"@+id/totalTime\" android:layout_width=\"wrap_content\"
android:text=\"00:00:00\" android:layout_height=\"wrap_content\"
android:layout_below=\"@+id/progressBar1\" android:paddingRight=\"5sp\"
android:layout_alignParentRight=\"true\"></TextView>
<LinearLayout android:id=\"@+id/ctrlBtnLayout\" style=\"@style/linear_hor_style\"
android:paddingTop=\"50sp\" android:layout_below=\"@+id/progressBar1\">
<ImageButton style=\"@style/ctrl_btn_style\" android:id=\"@+id/playImageButton\"
android:src=\"@drawable/play_button_selector\"></ImageButton>
<ImageButton style=\"@style/ctrl_btn_style\" android:id=\"@+id/pauseImageButton\"
android:src=\"@drawable/pause_button_selector\"></ImageButton>
<ImageButton style=\"@style/ctrl_btn_style\" android:id=\"@+id/stopImageButton\"
android:src=\"@drawable/stop_button_selector\"></ImageButton>
<Button android:id=\"@+id/fileSelectorButton\" android:text=\"@string/select_file_btn\"
android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"></Button>
</LinearLayout>
<LinearLayout android:id=\"@+id/statusUpdateLayout\"
style=\"@style/linear_ver_style\" android:background=\"@drawable/my_border\"
android:paddingTop=\"10sp\" android:layout_above=\"@+id/softKeysLayout\"
android:layout_below=\"@+id/ctrlBtnLayout\">
<TextView android:id=\"@+id/statusTextTitle\"
android:layout_height=\"wrap_content\" android:text=\"@string/status_update_title\"
android:padding=\"2sp\" android:layout_width=\"wrap_content\"></TextView>
<View style=\"@style/details_seperator\" android:id=\"@+id/statusUpdateSeperator\" />
<TextView android:id=\"@+id/statusText\"
android:layout_height=\"wrap_content\" android:editable=\"true\"
android:padding=\"2sp\" android:layout_width=\"wrap_content\"></TextView>
</LinearLayout>
<LinearLayout android:id=\"@+id/softKeysLayout\" style=\"@style/linear_hor_style\"
android:layout_alignParentBottom=\"true\" android:paddingTop=\"5sp\">
<Button style=\"@style/soft_key_btn\" android:text=\"@string/start_txt\"
android:id=\"@+id/selectButton\"></Button>
<Button style=\"@style/soft_key_btn\" android:text=\"@string/save_btn\"
android:id=\"@+id/saveButton\" android:enabled=\"false\"></Button>
<Button style=\"@style/soft_key_btn\" android:text=\"@string/back_btn\"
android:id=\"@+id/backButton\"></Button>
</LinearLayout>
</RelativeLayout>
</ScrollView>
</LinearLayout>
感谢和问候,
苏曼185
解决方法
将ѭ2的
android:layout_height
设为wrap_content
而不是fill_parent
, 我不知道确切原因和解决方案。但经过反复试验,它仍然有效。
我将\“ @ + id / statusUpdateLayout \”和\“ @ + id / softKeysLayout \”放在另一种相对布局中,例如
<relativelayout>
<linearlayout/>
<linearlayout/>
</relativelayout>
并删除了第一个linearlayout。我将scrollview作为根元素(只要删除第一个线性布局将scrollview作为根元素),现在它就可以正常工作了。