我創建一個自定義按鈕,並把它放在我的桌子的頁腳視圖但按鈕從右上角將會出路放置一個按鈕。表頁腳視圖
什麼是錯在這裏!?!
這裏是我的代碼,並輸出圖像:
UIButton *aButton = [UIButton buttonWithType:UIButtonTypeCustom];
[aButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[aButton setTitleColor:[UIColor colorWithWhite:0.0 alpha:0.56] forState:UIControlStateDisabled];
[aButton setBackgroundImage:[[UIImage imageNamed:@"test.png"] stretchableImageWithLeftCapWidth:kButtonSliceWidth topCapHeight:0] forState:UIControlStateNormal];
[aButton setTitle:@"Click me" forState:UIControlStateNormal];
[aButton.titleLabel setFont:[UIFont boldSystemFontOfSize:kFontSize14]];
[aButton setFrame:CGRectMake(10.0, 15.0, 300.0, 44.0)];
[self.tableView setTableFooterView:aButton];
不應幀是:(0.0,0.0,300.0,44.0)? – 2011-07-14 19:30:59
@Vince:這會讓按鈕畫在左上角,我相信Abhinav並不需要。 – EmilioPelaez
爲什麼不嘗試像這樣'CGRectMake(10.0,15.0,self.tableView.frame.size.width - 20,44.0)'設置框架? – EmilioPelaez