在对话框中使用Scrollview时出现的问题

阿努普里亚

我在对话框中放大了一个布局,该对话框包含一个滚动视图,但该布局没有滚动。我已经从stackoverflow引用了很多问题,但是后来也无法正常工作。我的layout.xml如下:

<?xml version="1.0" encoding="utf-8"?>
  <ScrollView 
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
         android:layout_height="match_parent"
        android:layout_margin="5dp"
        android:background="@color/White"
       >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/White"
        android:scrollbars="vertical"
            android:scrollbarAlwaysDrawVerticalTrack="true"
        android:orientation="vertical" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_margin="5dp"
            android:text="Update available"
            android:textColor="#000000" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:gravity="center"
            android:text="@string/upgrade_msg"
            android:textColor="#000000" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="300dp"
            android:layout_margin="3dp"
            android:layout_weight="0.02"
            android:src="@drawable/updateimg2" />

        <Button
            android:id="@+id/btn_upgrade"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/tv_forget_pwd"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:background="@color/White"
            android:gravity="center"
            android:text="Upgrade Now"
            android:textColor="@color/Black" />

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:scaleType="fitXY"
            android:src="@drawable/line_y_h" />

        <Button
            android:id="@+id/btn_remind"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/tv_forget_pwd"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:background="@color/White"
            android:gravity="center"
            android:text="Remind Me Later"
            android:textColor="@color/Blue" />

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:scaleType="fitXY"
            android:src="@drawable/line_y_h" />
    </LinearLayout>

</ScrollView>
  • 对话码

      public void show_Alert_version_custom(String str, final String url,
                final String exitStatus)// use for
        {
            final Dialog dialog = new Dialog(Splash.this);
            dialog.setContentView(R.layout.version_update);
            dialog.setTitle(getString(R.string.alert_title));
            Button dialogButton2 = (Button) dialog.findViewById(R.id.btn_remind);
            dialogButton = (Button) dialog.findViewById(R.id.btn_upgrade);
            ImageView viewLine = (ImageView) dialog.findViewById(R.id.imageView2);
    
    
            // if button is clicked, close the custom dialog
            dialogButton.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {}
            });
    
            // if button is clicked, close the custom dialog
            dialogButton2.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {}
            });
    
            dialog.show();
        }
    
阿努普里亚

ScrollView中的android:fillViewport =“ true”解决了我的问题。现在,即使在对话框中也可以滚动。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在对话框中使用Scrollview时出现的问题

来自分类Dev

在对话框中使用Drawable

来自分类Dev

使用“使用系统对话框打印”时出现的问题

来自分类Dev

在对话框窗口中使用ListControl

来自分类Dev

Codenameone-何时在对话框中使用callSerially?

来自分类Dev

在对话框中使用源命令

来自分类Dev

无法在对话框中使用sendKeys

来自分类Dev

如何在对话框中使用属性集

来自分类Dev

如何在对话框中使用 QnA 服务?

来自分类Dev

在对话框的第二个渲染中渲染Google地图时出现问题

来自分类Dev

在添加Android对话框时出现问题

来自分类Dev

关闭对话框时出现确认窗口问题?

来自分类Dev

在对话框中选择微调器时,Android espresso中出现RunTimeException

来自分类Dev

使用DialogBoxIndirect时,如何在对话框关闭时获取用户输入的文本?

来自分类Dev

在对话框中淘汰到ASP MVC问题

来自分类Dev

在对话框中使用ViewPager的最佳实践是什么

来自分类Dev

在对话框中使用<h1>在语义上正确吗?

来自分类Dev

如何在对话框中使用数字选择器

来自分类Dev

在对话框的负载回调中使用外部脚本?

来自分类Dev

NullPointerException在对话框中使用TabHost?怎么做对?

来自分类Dev

在对话框中增加对话框宽度的问题

来自分类Dev

加载页面时出现对话框

来自分类Dev

jqgrid出现在模态对话框中时出现免费的jqgrid 4.8覆盖问题

来自分类Dev

jqgrid出现在模态对话框中时出现免费的jqgrid 4.12覆盖问题

来自分类Dev

双击时打开对话框的问题

来自分类Dev

在对话框/弹出窗口上加载图像时,ANDROID进度对话框

来自分类Dev

如何在对话框加载时隐藏jQuery对话框按钮?

来自分类Dev

出现对话框

来自分类Dev

为什么我可以在活动/提要中使用onClick,但不能在对话框片段中使用onClick?

Related 相关文章

  1. 1

    在对话框中使用Scrollview时出现的问题

  2. 2

    在对话框中使用Drawable

  3. 3

    使用“使用系统对话框打印”时出现的问题

  4. 4

    在对话框窗口中使用ListControl

  5. 5

    Codenameone-何时在对话框中使用callSerially?

  6. 6

    在对话框中使用源命令

  7. 7

    无法在对话框中使用sendKeys

  8. 8

    如何在对话框中使用属性集

  9. 9

    如何在对话框中使用 QnA 服务?

  10. 10

    在对话框的第二个渲染中渲染Google地图时出现问题

  11. 11

    在添加Android对话框时出现问题

  12. 12

    关闭对话框时出现确认窗口问题?

  13. 13

    在对话框中选择微调器时,Android espresso中出现RunTimeException

  14. 14

    使用DialogBoxIndirect时,如何在对话框关闭时获取用户输入的文本?

  15. 15

    在对话框中淘汰到ASP MVC问题

  16. 16

    在对话框中使用ViewPager的最佳实践是什么

  17. 17

    在对话框中使用<h1>在语义上正确吗?

  18. 18

    如何在对话框中使用数字选择器

  19. 19

    在对话框的负载回调中使用外部脚本?

  20. 20

    NullPointerException在对话框中使用TabHost?怎么做对?

  21. 21

    在对话框中增加对话框宽度的问题

  22. 22

    加载页面时出现对话框

  23. 23

    jqgrid出现在模态对话框中时出现免费的jqgrid 4.8覆盖问题

  24. 24

    jqgrid出现在模态对话框中时出现免费的jqgrid 4.12覆盖问题

  25. 25

    双击时打开对话框的问题

  26. 26

    在对话框/弹出窗口上加载图像时,ANDROID进度对话框

  27. 27

    如何在对话框加载时隐藏jQuery对话框按钮?

  28. 28

    出现对话框

  29. 29

    为什么我可以在活动/提要中使用onClick,但不能在对话框片段中使用onClick?

热门标签

归档