bubblesout
Aspiring developer
Profile
Posts: 27
Reg: Aug 30, 2013
location unknow...
3,370
09/19/13 12:17 PM (12 years ago)

Scringo Like + Comment Button Positioning Issue

I followed the tutorials and added Scringo Like button and Comment Button. in addition to the tutorial i added this line (otherwise i got an error) ((UINavigationController*)[appDelegate.rootApp.rootTabBarController.viewControllers objectAtIndex: 1]).navigationBar.topItem.rightBarButtonItem = commentButton; Anyhow now I only see one button in my example - its the Comment Button, but I dont see the Like Button! here is my code: the like button has as positioning CGRectMake(40, 300, 50, 27)]; the comment button has as position CGRectMake(40, 330, 300, 27)]; but somehow it seems the 2nd is overlying the 1st one ?! i hope anyone can help me out ! --------- NSString *likeIt = [thisImage.jsonVars objectForKey:@"imageURL"]; ScringoLikeButton *likeButton = [[ScringoLikeButton alloc] initWithFrame:CGRectMake(40, 300, 50, 27)]; UIBarButtonItem *likeItButton = [[UIBarButtonItem alloc] initWithCustomView:likeButton]; //UNCOMMENT FOR TAB BAR LAYOUT ((UINavigationController*)[appDelegate.rootApp.rootTabBarController.viewControllers objectAtIndex: 1]).navigationBar.topItem.rightBarButtonItem = likeItButton; //UNCOMMENT FOR NON TAB BAR LAYOUT /*((UINavigationController*)[appDelegate.rootApp.rootNavController.retain retain ]).navigationBar.topItem.rightBarButtonItems = [NSArray arrayWithObjects:[ScringoAgent scringoActivationBarItem], likeItButton, nil]; */ [likeButton updateLikeObject:likeIt type:SCRINGO_APP_LIKE_IMAGE description:@"Awesome Pic !"]; NSString *commentPic = [thisImage.jsonVars objectForKey:@"imageURL"]; ScringoCommentButton *myCommentButton = [[ScringoCommentButton alloc] initWithFrame:CGRectMake(40, 330, 300, 27)]; UIBarButtonItem *commentButton = [[UIBarButtonItem alloc] initWithCustomView:myCommentButton]; ((UINavigationController*)[appDelegate.rootApp.rootTabBarController.viewControllers objectAtIndex: 1]).navigationBar.topItem.rightBarButtonItem = commentButton; [myCommentButton updateImageCommentObject:commentPic withTitle:@"Great Image !"];
 
bubblesout
Aspiring developer
Profile
Posts: 27
Reg: Aug 30, 2013
location unknow...
3,370
like
09/19/13 04:44 PM (12 years ago)
at the end i figured it out, via searching the forum again. dont forget the appDelegate part for tab navigations in front here the code: NSString *commentPic = [thisImage.jsonVars objectForKey:@"imageURL"]; ScringoCommentButton *myCommentButton = [[ScringoCommentButton alloc] initWithFrame:CGRectMake(40, 300, 50, 27)]; [myCommentButton updateImageCommentObject:commentPic withTitle:@"Great Image !"]; UIBarButtonItem *commentButton = [[UIBarButtonItem alloc] initWithCustomView:myCommentButton]; NSString *likeIt = [thisImage.jsonVars objectForKey:@"imageURL"]; ScringoLikeButton *likeButton = [[ScringoLikeButton alloc] initWithFrame:CGRectMake(40, 300, 50, 27)]; UIBarButtonItem *likeItButton = [[UIBarButtonItem alloc] initWithCustomView:likeButton]; [ScringoAgent setScringoActivationButtonType:(SCRINGO_BUTTON4)]; ((UINavigationController*)[appDelegate.rootApp.rootTabBarController.viewControllers objectAtIndex: 1]).navigationBar.topItem.rightBarButtonItems = [NSArray arrayWithObjects:commentButton, likeItButton, nil]; [likeButton updateLikeObject:likeIt type:SCRINGO_APP_LIKE_IMAGE description:@"Awesome Pic !"];
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
09/20/13 06:21 AM (12 years ago)
Great troubleshooting @bubblesout! LA
 
bubblesout
Aspiring developer
Profile
Posts: 27
Reg: Aug 30, 2013
location unknow...
3,370
like
09/20/13 08:10 AM (12 years ago)
thx LA starting is hard :)
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
09/20/13 08:14 AM (12 years ago)
Yes it can! LA
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.