gpt4 book ai didi

android - 如何以编程方式创建 ScrollView ?

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:51:20 25 4
gpt4 key购买 nike

我有一个表“TABLE_SUBJECT”,其中包含许多主题。我需要创造
一个带有主题的水平 ScrollView 。

如何以编程方式创建包含数据库项的 ScrollView?如果我输入 1o 主题,那么它将作为按钮出现在 ScrollView 中。可能吗?

最佳答案

您可以按如下方式创建它:

ScrollView scroll = new ScrollView(context);
scroll.setBackgroundColor(android.R.color.transparent);
scroll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
scroll.addView(yourTableView);

关于android - 如何以编程方式创建 ScrollView ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9887849/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com