Turn Views Editable on Android

心不动则不痛 提交于 2019-12-25 03:27:36

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/6461532/turn-views-editable-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!