Reputation: 1578
I have a custom UIButton like this:
_facebookButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_facebookButton addTarget:self
action:@selector(buttonFacebookPressed:)
forControlEvents:UIControlEventTouchDown];
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
[_facebookButton setBackgroundImage:[UIImage imageNamed:@"facebookInactive"] forState:UIControlStateNormal];
} else {
[_facebookButton setBackgroundImage:[UIImage imageNamed:@"facebookInactive"] forState:UIControlStateNormal];
}
_facebookButton.frame = CGRectMake(0.0, 0.0, 33.0, 33.0);
_facebookButton.center = CGPointMake(60, 48);
_facebookButton.alpha = 0;
[_subView addSubview:_facebookButton];
It is in a UITableViewCell and on the simulator it looks OK, but on the actual device it is gone. I've searched the internet and they are always talking about image names which are not correct. I use the xcasset and have an image set named: facebookInactive.
Why is the button not showing up on the device?
Thanks in advance!
Upvotes: 0
Views: 274
Reputation: 2006
you can goto your project in Project Navigator then
select your Project -> Build Phases -> Copy Bundle resourses and check that their is ".xcasset" avilable.
if No then click on "+" icon & add ".xcasset"
Now build & Run.
Upvotes: 0
Reputation: 798
You need to remove the statement
_facebookButton.alpha = 0;
or replace it with
_facebookButton.alpha = 1.0;
Upvotes: 0
Reputation: 106
Are you sure about that, ios Setting -> Facebook -> Sign in Process is completely registered ?
this may helpful to you.
Thanks & Regards, Rushik Thumar.
Upvotes: 1