小编Abh*_*bhi的帖子

iOS:图像在UIImageView中无法正常显示

我有一个UIImageView在其中UIImage正显示出它来自JSON.问题是我想设置cornerRadiusUIImageView.我为它添加了以下代码:

imgVw.layer.cornerRadius = 30.0;
imgVw.layer.borderWidth = 2.0;
imgVw.layer.borderColor = [UIColor blackColor].CGColor; 
Run Code Online (Sandbox Code Playgroud)

它以正确的方式显示cornerRadius和边框UIImageView但不显示.图像显示在角落之外,如屏幕截图所示.

在此输入图像描述

objective-c cornerradius uiimageview ios

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

iOS:如何获取两个坐标之间的路径路径

在我的项目中,我将借助纬度和经度找出两个位置之间的路径.

我正在使用以下代码

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [mapvw setDelegate:self];    
    [self mapp];
}


-(void)mapp
{
    CLLocationCoordinate2D coordinateArray[2];
    coordinateArray[0] = CLLocationCoordinate2DMake(28.6129, 77.2295);
    coordinateArray[1] = CLLocationCoordinate2DMake(28.6562, 77.2410);

    self.routeLine = [MKPolyline polylineWithCoordinates:coordinateArray count:2];
    [mapvw setVisibleMapRect:[self.routeLine boundingMapRect]]; //If you want the route to be visible
    [mapvw addOverlay:self.routeLine];
}


-(MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id<MKOverlay>)overlay
{
    if(overlay == self.routeLine)
    {
        if(nil == self.routeLineView)
        {
            self.routeLineView = [[MKPolylineView alloc] initWithPolyline:self.routeLine];
            self.routeLineView.fillColor = [UIColor redColor];
            self.routeLineView.strokeColor = …
Run Code Online (Sandbox Code Playgroud)

maps objective-c mkmapview ios

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

标签 统计

ios ×2

objective-c ×2

cornerradius ×1

maps ×1

mkmapview ×1

uiimageview ×1