Welcome, Guest
Username Password: Remember me

What delegates for changing tableView backGround color?
(1 viewing) (1) Guest

TOPIC: What delegates for changing tableView backGround color?

What delegates for changing tableView backGround color? 1 year, 8 months ago #1

I'm implementing the methods in the Core Data sample for iPad you sent, and all is working well, but some of my customizations are not working. Using delegate methods for cells (as noted in other posts works ok but for the life of me I cannot get the tableview background transparent. any changes to the tableView in IB are overridden it seems, and programmatic control is compiling but do nothing.

This is the steps so far: in my app delegate I create a background image and assign it as a subview of the window, thus:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
 
UIView *backgroundView = [[UIView alloc] initWithFrame: window.frame];
backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"myAppBG.png"]];
[window addSubview:backgroundView];
[backgroundView release];
//[window addSubview:self.navController.view];
[window makeKeyAndVisible];
 
return YES;
}

Note that the navController is disabled; this is to confirm that the image is placed and sized as a backdrop properly. This works ok. Uncommenting the navController then lets the RootController do it's thing and overlays the backdrop. Now, the trick is to make the background of the section tableView transparent; I have tried variants of this code in the RootController's viewDidLoad:
// Init the tableViewModel
tableViewModel = [[SCTableViewModel alloc] initWithTableView:self.tableView withViewController:self];
self.tableView.backgroundColor = [UIColor clearColor];
SCArrayOfObjectsSection *projectSection = [SCArrayOfObjectsSection sectionWithHeaderTitle:nil withEntityClassDefinition:projectDef];
projectSection.addButtonItem = self.navigationItem.rightBarButtonItem;
[tableViewModel addSection:projectSection];
 

Neither this code, variants, or tweaking the tableView in IB that is wired to the controller seems to work.
  • Geoffrey
  • OFFLINE
  • Senior Boarder
  • Posts: 48
  • Karma: 3

Re: What delegates for changing tableView backGround color? 1 year, 8 months ago #2

Have you unchecked the "Opaque" property in IB? Also, the following code should work:

 
self.tableView.backgroundColor = [UIColor clearColor];
self.tableView.opaque = NO;
self.tableView.backgroundView = nil;
 


BTW: any changes you do to your table view in Interface Builder are not overridden in any way, your table view will behave exactly as if you weren't using STV.

Hope this helps
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: What delegates for changing tableView backGround color? 1 year, 8 months ago #3

Yes! Now to get it into the delegate methods so the detail views match. Thanks!
  • Geoffrey
  • OFFLINE
  • Senior Boarder
  • Posts: 48
  • Karma: 3

Re: What delegates for changing tableView backGround color? 1 year, 8 months ago #4

You're welcome Geoffrey. Sorry I don't get your last comment, are you having any more issues or is everything working well now?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: What delegates for changing tableView backGround color? 1 year, 8 months ago #5

Actually there are a few remaining head-scratchers, and a couple new ones popped up. For the most part delegate methods for configuring the cells are working great but there are hiccups in getting tableView and View customization to work on all the views that STV pushes on the navigation stack. In testing I can drop the code directly in the appropriate SC class implementations (for testing only of course )but when I drop back to implement code in delegate methods it seems a few methods aren't firing, or I'm not implementing them correctly.

Also having issues identical to the earlier problems Codebonbon had with the white BG appearing in the cell label when navigating back to the top of an array of objects, and having default grey add and edit buttons appear in a bar set to Black Navigation Bar. I have yet to try the RC you just sent this morning, and will see if that helps.

Finally, an issue with iPad autorotation; implementing the usual method to enable this and it works fine until the user clicks an add button; the resulting editable view STV pushes forced back to portrait and rotation is dead until reboot.

I am out of the office at the moment but will post later this afternoon with details.
  • Geoffrey
  • OFFLINE
  • Senior Boarder
  • Posts: 48
  • Karma: 3

Re: What delegates for changing tableView backGround color? 1 year, 8 months ago #6

Hi Geoffrey,

1- This post provides some code samples on how to customize cells in detail views: www.sensiblecocoa.com/forum/sensible-tab...-properties.html#185 . You can also have full access to the detail view's SCTableViewModel by implementing the delegate method tableViewModel:detailViewWillAppearForRowAtIndexPath:withDetailTableViewModel: and accessing the "detailTableViewModel" property. Please tell me if you're still stuck with this.

2- Codebonbon issues have been resolved in the RC version you have, except the add/edit button on a black navigation bar issue which we are working on.

3- This auto rotation issue happens because the generated detail views do not implement the auto rotation methods. We're working on solving this too.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
Time to create page: 1.04 seconds