Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 不';不要在scrollview中显示任何内容_Android_Android Scrollview - Fatal编程技术网

Android 不';不要在scrollview中显示任何内容

Android 不';不要在scrollview中显示任何内容,android,android-scrollview,Android,Android Scrollview,当我尝试将自定义表格布局添加到scrollview时,没有显示任何内容。但是scrollview可以识别tablelayout(我从wrap_内容中理解)。如果我用另一个布局替换了scrollview,它可以正常工作。我解决了它。我在scrollview和TableLayout之间添加了一个中间层,它工作了 滚动视图 MainView root = findViewById(R.id.rootPanel); TableView tableview = createTableVie

当我尝试将自定义表格布局添加到scrollview时,没有显示任何内容。但是scrollview可以识别tablelayout(我从wrap_内容中理解)。如果我用另一个布局替换了scrollview,它可以正常工作。

我解决了它。我在scrollview和TableLayout之间添加了一个中间层,它工作了

滚动视图
    MainView root = findViewById(R.id.rootPanel);
    TableView tableview = createTableView();
    ScrollView scrollview = new ScrollView(this);
    scrollview.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT));

    scrollview.addView(tableview);
    root.addView(scrollview);