小编Nit*_*esh的帖子

自动布局(约束)Vs自动调整大小蒙版(弹簧和支柱)

无论屏幕大小和方向如何,这些布局系统都可帮助您调整大小.

如果我有自动调整大小掩码(弹簧和支柱)就像简单的解决方案,为什么我应该使用自动布局(约束)?

constraints objective-c ios autoresizingmask autolayout

7
推荐指数
1
解决办法
5722
查看次数

在textView的HTML属性文本上填充CSS不起作用

我正在使用HTML内容呈现textview.我已经采用了一些"div"标签并在其上应用了一些CSS.我在使用CSS类在"div"上应用填充时遇到了一个问题,该类在textview上渲染后没有反映div.我使用以下方法将HTML内容字符串转换为属性字符串.

if let htmlData = htmlContent.dataUsingEncoding(NSUnicodeStringEncoding, allowLossyConversion: true) {
    do {
        return try NSMutableAttributedString(
                       data: htmlData,
                       options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType],
                       documentAttributes: nil)
    }
    catch let error as NSError {
        printDebuggingMode("Couldn't translate \(htmlContent): \(error.localizedDescription) ")
    }
}
Run Code Online (Sandbox Code Playgroud)

我希望在textView的图像中实现下面附带的类似内容.

.padding {
    padding-left: 20px;
}
Run Code Online (Sandbox Code Playgroud)

uitextview nsattributedstring swift

7
推荐指数
1
解决办法
1180
查看次数

如何在 iOS 中获取缓冲区多边形坐标(纬度和经度)?

我在地图上用一组坐标创建了一个多边形。我需要关于在原始多边形边界之外制作一个给定距离的缓冲多边形的帮助。

所以我需要一种具有这种算法的方法,在该方法中我将坐标集作为输入传递,并且应该将缓冲的坐标集作为输出。

我试图通过为 ios 使用 arcgis 库和 AGSGeometryEngine 的 bufferGeometry 方法来实现这一点,但问题是,这是紧密耦合的,只能使用他们的 GIS 地图,但我使用的是 Mapbox,它是不同的地图。所以我想要一种可以独立于地图解决我的问题的通用方法。

在此处输入图片说明

polygon arcgis coordinates ios swift

5
推荐指数
1
解决办法
1999
查看次数

要求更改Google登录提醒中的应用名称

在此处输入图片说明

我们可以更改此警报中的突出显示文本以进行Google身份验证吗?实际上,它默认使用目标名称。但是我们的应用名称不同,那么有什么办法可以更改此警报?

google-login ios

5
推荐指数
1
解决办法
972
查看次数

如何使用默认以外的自定义项创建自定义UIMenuController?

每当用户选择任何文本时,我都要求在uiwebview上显示菜单项. 在此输入图像描述

我试过了

let highlightMenuItem = UIMenuItem(title: "Highlight", action: #selector(ViewController.hightlight))

UIMenuController.sharedMenuController().menuItems = [highlightMenuItem]
Run Code Online (Sandbox Code Playgroud)

但这只会添加更多菜单项和默认现有菜单项.就这样

在此输入图像描述 在此输入图像描述

有没有办法实现这一目标只有菜单项复制,突出显示和注意?

menuitem uimenucontroller swift

4
推荐指数
1
解决办法
6480
查看次数

在ios6.1中不推荐使用requestAccessToAccountsWithType,我应该使用什么呢?

- (void)getTwittersFollowers {ACAccountStore*store = [[ACAccountStore alloc] init]; ACAccountType*twitterAccType = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];

**[store requestAccessToAccountsWithType:twitterAccType withCompletionHandler:^(BOOL granted,NSError *error)**{
    if(!granted){
        NSLog(@"User refused to access to his account");
    }else{

        NSArray *twitterAcc=[store accountsWithAccountType:twitterAccType];

        if([twitterAcc count]>0){
            ACAccount *account=[twitterAcc objectAtIndex:0];
            NSLog(@"account name %@",[account accountDescription]);

            NSMutableDictionary *params=[[NSMutableDictionary alloc]init];
            [params setObject:@"1" forKey:@"inclue_entitles"];

            NSURL *url=[NSURL URLWithString:@"http://api.twitter.com/1/followers.json"];
            //TWRequest *request=[[TWRequest alloc]initWithURL:url parameters:params requestMethod:TWRequestMethodGET];
            SLRequest *request=[SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodPOST URL:url parameters:params];
            [request setAccount:account];
            [request performRequestWithHandler:^(NSData *responce,NSHTTPURLResponse *urlResponce,NSError *error){
                if(!responce){
                    NSLog(@"%@",error);
                }else{
                    NSError *jsonError;
                    NSMutableDictionary *followers=[NSJSONSerialization JSONObjectWithData:responce options:NSJSONReadingMutableLeaves error:&error];

                        if(followers!=nil){
                            for (int i=0; i<[[followers objectForKey:@"users"] …
Run Code Online (Sandbox Code Playgroud)

twrequest acaccountstore

2
推荐指数
1
解决办法
2029
查看次数