我的Android应用程序中有一个菜单,我想在菜单项的单击上滚动我的线性布局。我不想使用xml来做这件事。 拜托,我该怎么做? 注意:我在代码中使用了c#。
答案 0 :(得分:1)
你可以试试这个
ScrollView scroll = new ScrollView(context);
scroll.setBackgroundColor(android.R.color.transparent);
scroll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
scroll.addView(yourTableView);