简体   繁体   English

FBLoginView背景图像平铺(大小不正确)

[英]FBLoginView background image tiling (not resizing properly)

Having a weird issue with FBLoginView, basically it doesn't resize properly and ends up either stretching or tiling FBLoginView有一个奇怪的问题,基本上它不能正确调整大小,最终会拉伸或平铺

It was working fine on the previous version of my app, now that I'm coming to release a new update I've noticed it starts tiling the background image and generally not sizing as it should do? 在我的应用程序的先前版本上,它运行良好,现在我要发布一个新更新,我注意到它开始平铺背景图像,并且通常不按预期大小调整?

I've downloaded the latest version of the iOS SDK, tried integrating by Cocoapods and now just the normal .pkg install 我已经下载了最新版本的iOS SDK,尝试通过Cocoapods进行集成,现在仅是普通的.pkg安装

I'm using this code in my viewDidLoad method: 我在我的viewDidLoad方法中使用以下代码:


    FBLoginView *loginView = [[FBLoginView alloc] initWithReadPermissions:@[@"basic_info", @"email", @"user_likes"]];

loginView.delegate = self;

loginView.frame = CGRectMake(80.0, 247.0, 160.0, 40.0);

[self.view addSubview:loginView];
FBLoginView *loginView = [[FBLoginView alloc] initWithReadPermissions:@[@"basic_info", @"email", @"user_likes"]];

loginView.delegate = self; loginView.delegate =自我;

loginView.frame = CGRectMake(80.0, 247.0, 160.0, 40.0); loginView.frame = CGRectMake(80.0,247.0,160.0,40.0);

[self.view addSubview:loginView]; [self.view addSubview:loginView];

but achieving the result below which clearly isn't supposed to happen! 但是要达到以下结果显然不应该发生! Can't find any reference to it online and not sure why it would happen as I'm not doing anything unusual? 找不到在线引用,也不确定为什么我没有做任何不寻常的事情为什么会发生?

在此处输入图片说明

you need to remove the [loginView sizeToFit]; 您需要删除[loginView sizeToFit]; method to get rid of the view clipping. 摆脱视图裁剪的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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