简体   繁体   中英

How to change FBLoginView width

I simply need to increase the width of Facebook FBLoginView.

Hence, I try to change the frame width, but it seems it have no effect.

I can see x,y can be changed, but not width ,why?

(void)viewDidLoad {
    [super viewDidLoad];

      CGRect usableBounds =[[UIScreen mainScreen] bounds]; 
    // Create Login View so that the app will be granted "status_update" permission.
    FBLoginView *loginview = [[FBLoginView alloc] init];


    loginview.frame= CGRectOffset(loginview.frame,
                                      ([[UIScreen mainScreen] bounds].size.width-loginview.frame.size.width)/2,
                                      ([[UIScreen mainScreen] bounds].size.height-loginview.frame.size.height)/2 -50);


    loginview.delegate = self;

    [self.view addSubview:loginview];

    [loginview sizeToFit];

you need to remove the [loginView sizeToFit]; method to get rid of the view clipping.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM