IOS10 App's permission to adapt to the Push Notifications font Frame !!!!, Ios10notifications

Source: Internet
Author: User

IOS10 App's permission to adapt to the Push Notifications font Frame !!!!, Ios10notifications

Add configuration permission

<! -- Album --> <key> NSPhotoLibraryUsageDescription </key> <string> "xx" requires your permission to use your album </string> <! -- Camera --> <key> NSCameraUsageDescription </key> <string> "xx" requires your permission to use your camera </string> <! -- Microphone --> <key> NSMicrophoneUsageDescription </key> <string> "xx" requires your permission to use your microphone </string> <! -- Location --> <key> NSLocationUsageDescription </key> <string> "xx" to access your location, please allow </string> <! -- Calendar --> <key> NSCalendarsUsageDescription </key> <string> "xx" to access your calendar, please allow </string> <! -- Media database --> <key> NSAppleMusicUsageDescription </key> <string> "xx" to access your media database, please allow </string> <! -- Bluetooth --> <key> nsbluw.thperipheralusagedescription </key> <string> "xx" to access your Bluetooth, please allow </string> <! -- Address book --> <key> NSContactsUsageDescription </key> <string> "xx" wants to access your address book, please allow </string> <key> NSLocationWhenInUseUsageDescription </key> <string> click "allow ". If not, you will not be able to use the "nearby" function normally. </String>

Add Push Notifications support

 

The xxxx. entitlements file is automatically generated when the switch is enabled.

Note the following points:

Whether the generated file is included in Bundle Resources in your package project. If not manually added

 

We recommend that you do not use Automatically manage signing if the project has multiple targets and multiple certificates are together.

Use the following method

 

Summary

The first one is for multiple apps. Therefore, you must specify the corresponding certificate when configuring the certificate. The automatic adaptation will be inaccurate, because our multiple projects are divided into multiple targets and many projects are shared.

The second is to include the generated entitlements file in the bundle.

 

Adaptive font

The best way to adapt to sb text in ios is to manually change the frame.

For a code-only page, you can add some frames according to the ratio when calculating the font size.

+ (CGSize) textFrameWithString :( NSString *) text width :( float) width fontSize :( NSInteger) fontSize {NSDictionary * dict =@{ NSFontAttributeName: [UIFont systemFontOfSize: fontSize]}; // based on the text content of the first parameter, the maximum size of 280 * float is used, and the system 14 character is used to return a real frame size: (280 * xxx )!! CGRect frame = [text boundingRectWithSize: CGSizeMake (width, CGFLOAT_MAX) options: NSStringDrawingUsesLineFragmentOrigin attributes: dict context: nil]; CGSize textSize = frame. size; CGFloat scale = 17.5/17.0; // iOS 10 if ([[UIDevice currentDevice]. systemVersion floatValue]> = 10.0) {textSize. width = textSize. width * scale; textSize. height = textSize. height * scale;} return textSize ;}

 

IOS10 many pitfalls are coming soon.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.