小编Nar*_*dey的帖子

使用GMUClusterManager的自定义标记

我想显示自定义标记使用GMUClusterManager.我在这里遵循标记聚类的所有步骤.

但是有这样的蓝色和红色图标. 在此输入图像描述

但是,当我放大该地图时,它只显示红色标记,但我不希望这样.

有实例方法,我已经实现了我的逻辑,但没有用.

    - (instancetype)initWithMapView:(GMSMapView *)mapView clusterIconGenerator:(id<GMUClusterIconGenerator>)iconGenerator
{
    if ((self = [super init])) {

        GMSMarker *marker= [GMSMarker markerWithPosition:CLLocationCoordinate2DMake(24.0, 75.30)];

        UIView *customMarker =[[UIView alloc] initWithFrame:CGRectMake(0, 0, 63, 40)];
        customMarker.backgroundColor = [UIColor blueColor];

        marker.iconView = [self EmployeeMarker:0] ;
        marker.appearAnimation = kGMSMarkerAnimationPop;
        marker.map = mapView;
    }
    return self;
}

-(UIView *)EmployeeMarker:(int)labelTextInt{
    UIView *customMarker =[[UIView alloc] initWithFrame:CGRectMake(0, 0, 63, 40)];
    UIImageView *imgViewCustomMarker = [[UIImageView alloc]initWithFrame:CGRectMake(0, 15, 24, 25)];
    imgViewCustomMarker.image = [UIImage imageNamed:@"iconMapUser.png"];
    [customMarker addSubview:imgViewCustomMarker];
    UIView *viewRatingCustom = [[UIView alloc] …
Run Code Online (Sandbox Code Playgroud)

google-maps objective-c markerclusterer ios

9
推荐指数
2
解决办法
3384
查看次数

UIAlertController和UIAlertControllerStyleActionSheet定制

我正在尝试创建具有样式UIAlertControllerStyleActionSheet(以前称为UIActionSheet)的自定义UIAlertController,并且遇到了很多麻烦,无法简单地对其进行自定义。我希望UIAlertAction 在左侧包含一个图像减小按钮的大小

我知道这是可行的:

在此处输入图片说明

(这正是我想要的)

我搜索了几个小时,但在互联网上找不到任何可以帮助我完成此简单任务的tut。另外,由于UIActionSheet自IOS 9起就已弃用,因此每当我尝试查找解决方案时,它便不再可用。另外,我读到UIAlertController不打算被子类化。

有谁知道如何实现警报的轻量级定制?我是否必须对UIView进行细分才能制作自己的警报表?

objective-c ios

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

计算所有尺寸的iphone的纵横比

我知道这个类型的问题已被问过几次,但我对iphone比较新,所以对所有的答案都很困惑.因为我的标识是61*57,我想根据iphone的大小改变.但是当我为所有屏幕指定它的宽高比时,它会给出自己的比例.但我很困惑这个比率是如何计算的.对于5.5英寸,他们推荐17:184为4.7 61:667 4英寸61:568和3.5英寸61:480.

iphone ios

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

在集合视图中一次滚动一个单元格

使用该willDisplayCell方法,我得到了最后一个可见单元格的索引:

- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {       
   indexVisibleCell = [indexPath indexAtPosition:[indexPath length] - 1];
}
Run Code Online (Sandbox Code Playgroud)

这里indexVisibleCell是一个NSUInteger是在类的接口中声明。我的问题是,当用户点击向右或向左按钮时,我只希望移动一个单元格。我已经为此目的应用了此代码:

- (IBAction)rightButton:(id)sender {
    NSUInteger indexOfScrolledCell;
    indexOfScrolledCell = indexVisibleCell;

  if (indexVisibleCell < 9) {            
        NSIndexPath *path = [NSIndexPath indexPathForRow:indexOfScrolledCell+1 inSection:0];

        [self.obj_CollectionView1 scrollToItemAtIndexPath:path atScrollPosition:UICollectionViewScrollPositionLeft animated:YES];            
    }     
}
Run Code Online (Sandbox Code Playgroud)

因为我一次显示3个单元格。通过使用rightButton动作方法,它一次移动3个单元格,而不是一个。请帮助我弄清楚如何一次滚动一个单元格。

objective-c ios

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

标签 统计

ios ×4

objective-c ×3

google-maps ×1

iphone ×1

markerclusterer ×1