如何将工具栏添加到UITableView obj-c / ios / xcode的BOTTOM [英] How to add a toolbar to the BOTTOM of a UITableView obj-c/ios/xcode
本文介绍了如何将工具栏添加到UITableView obj-c / ios / xcode的BOTTOM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在tableview底部添加带有uitextfield的Programmaticaly工具栏?喜欢聊天或短信应用..提前谢谢..
how do I add Programmaticaly a toolbar with uitextfield at the bottom of a tableview? Like a chat or sms app.. thank you in advance..
推荐答案
首先创建一个视图来保存整个事物。
然后添加一个UITableview和UIToolbar以编程方式设置框架,使其显示在tableview下。将文本字段添加到工具栏
First create a view to hold the whole thing. Then add a UITableview and UIToolbar programmatically set frame so that it appears under the tableview .Add the textfield to the toolbar
UIView *placeholderView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 400, 440)];
UITableView *tv=[[UITableView alloc]initWithFrame:CGRectMake(0, 0, 400, 400)];
[placeholderView addSubview:tv];
UIToolbar *toolBar=[[UIToolbar alloc]initWithFrame:CGRectMake(0, 400, 400, 40)];
[placeholderView addSubview:toolBar];
这篇关于如何将工具栏添加到UITableView obj-c / ios / xcode的BOTTOM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文