如何在不使用Interface Builder的情况下更改为xcode中的分组表视图 [英] How to change to a grouped table view in xcode without using Interface Builder
问题描述
我有一个我在xcode中创建的表,所以在这种情况下没有nib文件。我想把我的桌子变成'Grouped'风格,但我不确定如何。
I have a table that I created within xcode so there is no nib file in this case. I want to make my table into the 'Grouped' style but im not sure how.
我认为它与下面的方法有关,问题是我不是真的很确定如何调用它,我确实理解方法如何工作我只是不太确定从哪一个开始:
I think it has somthing to do with the method below, the problem is Im not really sure how to call it, I do understand how methods work I'm just not too sure on where to start with this one:
- (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)UITableViewStyleGrouped
也可能有人告诉我怎么称呼它?问题是它不是我写的一个内置的方法,所以我可以将该行放入我的头文件,但我如何在我的实现文件中使用它?
So could someone tell me how to call it? The problem is that its not a method I wrote its a built in one so I could put that line into my header file but how would I use it in my implementation file?
谢谢大家,
推荐答案
听起来你需要更好地了解objective-c的工作原理。你给我们的不是方法,而是方法声明。在你的控制器viewDidLoad:中,你会做类似的事情:
It sounds like you need to get a better understanding of how objective-c works. What you have given us is not a method, but a method declaration. In your controllers viewDidLoad:, you would do something like:
table = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStyleGrouped];
这篇关于如何在不使用Interface Builder的情况下更改为xcode中的分组表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!