相关疑难解决方法(0)

滚动视图内的Android列表视图

我有一个android布局,其中包含scrollView许多元素.在scrollView我的底部有一个listView然后由适配器填充.

,我遇到的问题是,Android是不包括listViewscrollView作为scrollView已经具有滚动能够功能.我希望listView只要内容和主滚动视图是可滚动的.

我怎样才能实现这种行为?

这是我的主要布局:

<ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="2"
    android:fillViewport="true"
    android:gravity="top" >

    <LinearLayout
        android:id="@+id/foodItemActvity_linearLayout_fragments"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
    </LinearLayout>

</ScrollView>
Run Code Online (Sandbox Code Playgroud)

然后我以编程方式将我的组件添加到具有id:的linearlayour foodItemActvity_linearLayout_fragments.下面是加载到该线性布局中的一个视图.这是给我卷轴问题的那个.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <TextView
       android:id="@+id/fragment_dds_review_textView_label"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="Reviews:"
       android:textAppearance="?android:attr/textAppearanceMedium" />

   <ListView
       android:id="@+id/fragment_dds_review_listView"
       android:layout_width="match_parent"
       android:layout_height="wrap_content">
   </ListView>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我的适配器然后填写此列表视图.

当我点击主滚动视图时,这是来自android层次结构查看器的图像:

滚动视图中的Android列表视图

如您所见,它排除了评论listView.

我应该能够向下滚动页面并查看8条评论,但它只向我展示了那些3,我可以滚动查看评论的小部分.我想要一个全局页面滚动

android android-layout android-scrollview

258
推荐指数
11
解决办法
27万
查看次数

Android - 如何使此警报对话框可滚动?

我是android的初学者,并制作我的第一个Android应用程序.点击后,我的"关于"菜单项会显示一条带有非常长消息的alertdialog.我一直在尝试不同的方法使其可滚动,但我不能.我曾尝试在stackoverflow上阅读不同的问题,但它们对我没有用.这是我的警报对话框代码.

AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);  
alertDialog.setTitle("Title");  
alertDialog.setMessage("Here is a really long message.");  
 alertDialog.setButton("OK", null);  
 AlertDialog alert = alertDialog.create();
alert.show();
Run Code Online (Sandbox Code Playgroud)

任何人都可以详细解释我如何使其可滚动?任何帮助或建议将不胜感激!

android android-alertdialog

18
推荐指数
2
解决办法
5万
查看次数