编程开启iOS emoji
编程开启iOS emoji
emoji是日本人开发的一字符编码集,在iOS中集成了该字符集。 可以通过编程的方式激活emoji。
首先判断是否支持emoji:
- - (BOOL)supportEmoji
- {
- BOOL hasEmoji = NO;
- #define kPreferencesPlistPath @"/private/var/mobile/Library/Preferences/com.apple.Preferences.plist"
- NSDictionary *plistDict = [[NSDictionary alloc] initWithContentsOfFile:kPreferencesPlistPath];
- NSNumber *emojiValue = [plistDict objectForKey:@"KeyboardEmojiEverywhere"];
- if (emojiValue) //value might not exist yet
- hasEmoji = YES;
- else
- hasEmoji = NO;
- [plistDict release];
- return hasEmoji;
- }
- - (void)valueControl:(BOOL)open
- {
- #define kPreferencesPlistPath @"/private/var/mobile/Library/Preferences/com.apple.Preferences.plist"
- NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:kPreferencesPlistPath];
- [plistDict setValue:[NSNumber numberWithBool:open] forKey:@"KeyboardEmojiEverywhere"];
- [plistDict writeToFile:kPreferencesPlistPath atomically:NO];
- [plistDict release];
- }
Go to Settings > General > International > Keyboards > Japanese and enable the Emoji keyboard.
评论暂时关闭