I simply want to have a static table View with items in it. I used Xcode 4.2 with storyboard for this task. So I created a TableView with a tableViewController (subclass UITableViewController). I defined the content as "Static Cells" and style "Grouped".
After that I put some lables and all those objects I want to have in those cells. I created Outlets in the tableViewController:
#import <UIKit/UIKit.h>
@interface tableviewcontroller : UITableViewController
@property (weak, nonatomic) IBOutlet UILabel *label1;
@property (weak, nonatomic) IBOutlet UILabel *label2;
@property (weak, nonatomic) IBOutlet UISegmentedControl *segmented;
@property (weak, nonatomic) IBOutlet UIImageView *imageview;
@property (weak, nonatomic) IBOutlet UITextView *text;
@end
put some content in the cell-label:
- (void)viewDidLoad
{
[super viewDidLoad];
self.label1.text = @"This is a title";
self.label2.text = @"Annika";
self.imageview.image = [UIImage imageNamed: @"picture.jpg"];
}
After build and run, it doesn't show me any of the elements... what did I do wrong?
Left: In storyboard, right: In the simulator.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…