如何使的LinearLayout滚动而不使用滚动 [英] how to make LinearLayout scrollable without using Scrollview
问题描述
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/bag"
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/relativeLayout2"
style="@style/relbag"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView style="@style/CodeFont"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="18dp"
android:textSize="15dp"
android:text="General Preference"
android:id="@+id/genpref">
</TextView>
<ListView
android:id="@+id/settingsListView1"
style="@style/listbag"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:background="@drawable/radius"
android:listSelector="@drawable/list_selector"
android:paddingTop="8dip"
android:paddingBottom="8dip"
android:scrollbars="none"
android:layout_below="@id/genpref"/>
<TextView style="@style/CodeFont"
android:id="@+id/notpref"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="25dp"
android:textSize="15dp"
android:text="Notification Preference"
android:layout_below="@id/settingsListView1">
</TextView>
<ListView style="@style/listbag" android:id="@+id/settingsListView2" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="15dip" android:layout_marginRight="15dip"
android:layout_marginBottom="15dip"
android:background="@drawable/radius"
android:paddingLeft="5dip" android:paddingRight="5dip"
android:paddingTop="15dip" android:paddingBottom="15dip"
android:listSelector="@drawable/list_selector"
android:layout_below="@id/notpref"
android:scrollbars="none"
/>
</RelativeLayout>
</LinearLayout>
在我的应用我要创建两个列表视图到LinearLayout中做出的LinearLayout滚动不使用滚动。至于我读滚动视图与列表视图的工作一个问题。这张图片是不正是我想要的,但让我们pretend有以下列表视图的另一个列表视图。所以,我想显示ListView控件的所有可用的项目(在我的应用程序列表视图2的项目),并滚动的LinearLayout。滚动型不精去,因为它必须只有一个直接子。我无法找到解决办法。所以,请帮我做的解决方案,谢谢
In my app I want create two listview into linearlayout and make linearlayout scrollable not using ScrollView. As far as I read scrollview has a issues working with listview. This picture isn't exactly what I want but let's pretend there is another listview below of listview. So I want display listview's all available items (in my app 2 listview's items) and make LinearLayout scrollable. ScrollView doesn't go fine because it has to have only one direct child. I can't find solution. So please help me make solution, Thanks
推荐答案
我不认为它是个好主意,把多个列表在一个屏幕becoz触摸将变得怪异而使用屏幕将成为complex.You应该想别的东西在一个screen.You显示多个列表在一个单一的screen.Romain盖伊(谷歌开发者)可以横向排列多个列表也接受了这一事实在下面的链接....
I dont think its a good idea to put multiple lists in a single screen becoz touch will become weird and using screen will become complex.You should think something else to display multiple lists together in a single screen.You can horizontally arrange multiple lists in a single screen.Romain Guy(Google developer) is also accepting this fact in the following link....
<一个href=\"http://groups.google.com/group/android-developers/browse_thread/thread/77acd4e54120b777\">http://groups.google.com/group/android-developers/browse_thread/thread/77acd4e54120b777
我希望这回答将帮助ü解决乌尔问题。
I hope this answer will help u to solve ur problem.
这篇关于如何使的LinearLayout滚动而不使用滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!