开发者

imageView.contentScaleFactor = 1.0; error in 3.2 sdk. How do I solve the problem?

开发者 https://www.devze.com 2023-02-04 13:40 出处:网络
I get error in 3.2 sdk. imageView.contentScaleFactor = 1.0; error: request for member \'contentSc开发者_StackOverflowaleFactor\' in something not a structure or union. How do I solve the problem?You m

I get error in 3.2 sdk. imageView.contentScaleFactor = 1.0; error: request for member 'contentSc开发者_StackOverflowaleFactor' in something not a structure or union. How do I solve the problem?


You may check if the function is supported by using the following construct:

if( [imageView respondsToSelector:@selector(setContentScaleFactor:)] ) {
    [imageView setContentScaleFactor: 1.0];
} else {
    // Function not supported, work around the issue
}

You could pack that into a #define macro to make usage easier.

EDIT: Missed double colon in "@selector(...)"

0

精彩评论

暂无评论...
验证码 换一张
取 消