android 如何在布局开始时添加视图? [英] android How to add view at start of layout?

查看:20
本文介绍了android 如何在布局开始时添加视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题很简单.我有一个线性布局.它有一些子视图.现在我想在孩子的开头添加一个视图.表示在正常的 addView(view) 中,view 添加在布局的末尾.但我想在开始时添加它,在第一个位置.有什么想法...???

My question is simple. I have a linearlayout. It has some child views. Now I want to add a view at the start of the child. Means in normal addView(view), the view s added at the end of the layout. But I want to add it at start, at first position. Any idea...???

推荐答案

使用 addView (View child, int index) with index = 0

Use addView (View child, int index) with index = 0

这篇关于android 如何在布局开始时添加视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆