0

I'm trying to get Shimmer on a programmatically added button. It's a QBFlatButton, userStateButton = [[QBFlatButton alloc] initWithFrame:CGRectMake((cellView.frame.size.width - (80 + 20)), (self.screenHeight/(cellCount * 4)), 80, ((self.screenHeight + (cellCount * cellCount))/(cellCount * 2)))];

When I turn Shimmer on, the entire bounds that I've set for the button start shimmering (no surprise there, thats what I set the bounds as) FBShimmeringView *shimmeringView = [[FBShimmeringView alloc] initWithFrame:userStateButton.bounds];

screen shot 2014-04-28 at 11 21 10 am

How would I get just the text of the button to shimmer? I've already tried making the frame of the shimmeringView the frame of the titleLabel (which it turns out is {{0, 0}, {0, 0}}

Any way to do this?

user3451350
  • 61
  • 2
  • 8

1 Answers1

0

You need to set the contentView property of the FBShimmerView. The size of the view will be adjusted to ensure proper effect is achieved so you don't have to set the bounds.