开发者

ipad table occupying whole screen but not designed to do that?

In my iPad app, I'm designing a table view that uses a check box in table cells, but the table is occupying the whole screen even though is just a small table in Interface Builder.

What am I doing wrong? Why is this table taking up the whole screen? A link to my little project is here. here


ok, sorry for the noobnes!! so I fixed by changing my view controller duuhhhh from UITableViewController to UIViewController

but now I have another problem!! the

[self.tableView reloadData];

gives me an error! so how can I fix to render properly the change of the button with out going back to UITableViewController!

thank you! Wright CS!!

another thing please,

to allow the if to compare if the cell was hit, I have a sintax problem>

  • (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES];
// here PROBLEM
if ([[dataList objectAtIndex:indexPath.row] isEqual:@"Sports"] )
{
    NSLog(@"perra");
    //Sports *sports = [[Sports alloc] initWithNibName:@"Sports" bundle:nil]; 
    //[self.navigationController pushViewController:sports animated:YES];
    //[sports release];

    //sports = [[Sports alloc] initWithNibName:@"Sports" bundle:nil];

    //anima
    //[UIView beginAnimations:@"flipping view" context:nil];
    //[UIView setAnimationDuration:1];
    //[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    //[UIView setAnimationTransit开发者_JAVA百科ion:UIViewAnimationTransitionCurlDown 
    //                     forView:self.view cache:YES];

    //[self.view addSubview:sports.view];
    //[UIView commitAnimations];



}

else if ([[dataList objectAtIndex:indexPath.row] isEqual:@"Entertainment"] )
{
    NSLog(@"parra");
    // *blue = [[Blue alloc] initWithNibName:@"Blue" bundle:nil]; 
    //[self.navigationController pushViewController:blue animated:YES];
    //[blue release];
}

   }


The reason your table is "full screen" is because it is a UITableViewController. Make it a UIViewController and then you can programmatically set the frame, or build it in Interface Builder.

@interface TableCellViewController : UIViewController <UITableViewDelegate,UITableViewDataSource> 
{
    IBOutlet UITableView *tblCustomCell;
}

@property(nonatomic,retain) UITableView *tblCustomCell;

@end

and in your .m, @synthesize tblCustomCell; and don't forget to connect everything in IB.

then if you need to call reloadData, use:

    [tblCustomCell reloadData];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜