问题描述
是否有可能把一个视图编辑如
我知道我能做到这一点使用一个GridView。但是,我试着去做到这一点与TableRows,这可能吗?
编辑:我真正想要做的是构建一些界面删除的TableRow
当然,你可以从你的TableLayout删除的TableRow。你必须跟踪在表中的不同意见(行),然后就打电话 removeView
当你想删除一个。
编辑(回答你的问题在评论)
是的,你可以动态地编辑视图。例如,如果你的TableRow是一个水平的LinearLayout,你可以调用 addView
像你这样(使按钮不可见)的作品太...不让它走的空间中的TableRow,使用的的
Is it possible to turn a view editable like this image?
I know I can do that using a GridView. But, Im trying to do that with TableRows, is it possible?
Edited: What I really wanna to do is to construct some interface to delete a TableRow.
Sure, you can remove TableRow from your TableLayout. You'll have to keep track of the different views (rows) in your table and then just call removeView
when you want to delete one.
Edit (answer to your question in the comments) :
Yes, you can edit the View dynamically. For example, if your TableRow is an horizontal LinearLayout, you can call addView
Like you did (making the button invisible) works too... to not make it take space in the TableRow, use gone instead.
这篇关于打开浏览Android上编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!