【问题标题】:Android add textview above other textviewsAndroid 在其他 textviews 之上添加 textview
【发布时间】:2015-07-04 00:10:07
【问题描述】:

我开发了一个动态创建文本视图的应用程序,期望的结果是:

textview1
textview2
textview3

(然后当用户创建一个新的文本视图)

textview4
textview1
textview2
textview3

但到目前为止,textview4 在 textview3 之下

文本视图在线性布局下。

我怎样才能达到预期的效果?

谢谢。

【问题讨论】:

  • 你能用xml显示一些代码吗..

标签: java android textview android-linearlayout android-relativelayout


【解决方案1】:

你需要使用:

addView (View child, int index)

索引是视图中的位置(如果你想把它放在顶部,则为 0)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-01-28
    • 1970-01-01
    • 1970-01-01
    • 2021-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多