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

查看:104
本文介绍了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...???

推荐答案

使用

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

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

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