相关疑难解决方法(0)

UITextView lineSpacing使光标高度不同

我正在使用NSMutableParagraphStyleUITextview在每行文本之间添加行间距.

当我在textview中输入内容时,光标高度正常.但是当我将光标位置移动到第二行(而不是最后一行)上的文本时,光标高度变得越来越大.

大插入符号

如何在文本的每一行中使光标高度正常?这是我目前正在使用的代码:

NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = 30.;
textView.font = [UIFont fontWithName:@"Helvetica" size:16];
textView.attributedText = [[NSAttributedString alloc] initWithString:@"My Text" attributes:@{NSParagraphStyleAttributeName : paragraphStyle}];
Run Code Online (Sandbox Code Playgroud)

objective-c ios swift

23
推荐指数
2
解决办法
6898
查看次数

在Mapbox上添加模糊效果

我想在mapbox中添加模糊效果.第一次加载地图时,时间只显示地图中的当前位置其他地图是蓝色.

在此输入图像描述

当我将用户位置移动到另一个位置时,地图上的其他位置清晰.另外在特定位置显示注释,请参见屏幕截图

在此输入图像描述

帮助我如何实现这一点

在这里,我将实现一些代码

- (CGPoint)convertLatLongCoord:(CGPoint)latLong {
    CGSize screenSize = [UIScreen mainScreen].applicationFrame.size];
    CGFloat SCALE = MIN(screenSize.width, screenSize.height) / (2.0 * EARTH_RADIUS);
    CGFloat OFFSET = MIN(screenSize.width, screenSize.height) / 2.0;
    CGFloat x = EARTH_RADIUS * cos(latLong.x) * cos(latLong.y) * SCALE + OFFSET;
    CGFloat y = EARTH_RADIUS * cos(latLong.x) * sin(latLong.y) * SCALE + OFFSET;

    return CGPointMake(x, y);
}

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations
{
    NSLog(@"data=%f",self.mapview.userLocation.coordinate.latitude);
    CLLocation *currentLoc=[locations objectAtIndex:0];
    _coordinate=currentLoc.coordinate;
CGPoint latLong = {_coordinate.latitude, _coordinate.longitude};
    oldcord = [self convertLatLongCoord:latLong];
    NSLog(@"Cartesian Coordinate: (%f, %f)",oldcord.x, …
Run Code Online (Sandbox Code Playgroud)

objective-c ios mapbox

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

如何更改特定 UITextField 的闪烁条/线的大小?


我正在开发一个项目(Swift4,Xcode 9.2),该项目具有获取文本输入的功能,并且闪烁的条/线应该很大(it should be Square instead of bar/line),所以我UITextField为 Text放置了一个,但我不明白如何更改该闪烁的线/条的大小.

那么,是否可以更改线/条的大小?如果是,那么该怎么做?我知道如何改变那条线/条的颜色,但这是不同的。

caret uitextfield ios swift

5
推荐指数
2
解决办法
1762
查看次数

标签 统计

ios ×3

objective-c ×2

swift ×2

caret ×1

mapbox ×1

uitextfield ×1