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