小编Tie*_*nLe的帖子

在iOS8中更改操作表弹出箭头

我正在使用UIAlertController.但是在iOS 8的iPad上,actionSheet显示了弹出式箭头.任何隐藏箭头的想法?

这是我的代码:

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"this is alert controller" message:@"yeah" preferredStyle:UIAlertControllerStyleActionSheet];

            UIAlertAction *cancelAction = [UIAlertAction
                                           actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel action")
                                           style:UIAlertActionStyleCancel
                                           handler:^(UIAlertAction *action)
                                           {
                                               NSLog(@"Cancel action");
                                           }];

            UIAlertAction *okAction = [UIAlertAction
                                       actionWithTitle:NSLocalizedString(@"OK", @"OK action")
                                       style:UIAlertActionStyleDefault
                                       handler:^(UIAlertAction *action)
                                       {
                                           NSLog(@"OK action");
                                       }];

            UIAlertAction *deleteAction = [UIAlertAction
                                           actionWithTitle:NSLocalizedString(@"Delete", @"Delete action")
                                           style:UIAlertActionStyleDestructive
                                           handler:^(UIAlertAction *action) {
                                               NSLog(@"Delete action");
                                           }];

            [alertController addAction:cancelAction];
            [alertController addAction:okAction];
            [alertController addAction:deleteAction];

            UIPopoverPresentationController *popover = alertController.popoverPresentationController;
            if (popover) {
                popover.sourceView = self.view;
                popover.sourceRect = self.view.bounds;
                popover.permittedArrowDirections = UIPopoverArrowDirectionUnknown;
            } …
Run Code Online (Sandbox Code Playgroud)

uiactionsheet ipad uipopovercontroller ios8 uialertcontroller

21
推荐指数
3
解决办法
2万
查看次数

iOS - 如何在没有游戏的情况下从视频获取缩略图?

我正在尝试从视频中获取缩略图并在我的tableview中显示它.这是我的代码:

- (UIImage *)imageFromVideoURL:(NSURL *)contentURL {
    AVAsset *asset = [AVAsset assetWithURL:contentURL];

    //  Get thumbnail at the very start of the video
    CMTime thumbnailTime = [asset duration];
    thumbnailTime.value = 25;

    //  Get image from the video at the given time
    AVAssetImageGenerator *imageGenerator = [[AVAssetImageGenerator alloc] initWithAsset:asset];

    CGImageRef imageRef = [imageGenerator copyCGImageAtTime:thumbnailTime actualTime:NULL error:NULL];
    UIImage *thumbnail = [UIImage imageWithCGImage:imageRef];
    CGImageRelease(imageRef);

    return thumbnail;
}
Run Code Online (Sandbox Code Playgroud)

但是图像总是回归黑色.怎么了?

image ios video-thumbnails

10
推荐指数
3
解决办法
1万
查看次数

如何在iOS谷歌地图中显示所有信息窗口而无需点击标记?

我正在尝试创建标记而不需要点击.但我不能显示所有infoWindows.它只显示最后一个标记上的一个infowindow.

这是我的代码:

- (void)viewDidLoad {
    [super viewDidLoad];
    NSMutableArray *markersArray = [[NSMutableArray alloc] init];
    for(int i=0; i<10; i++){
        GMSMarker *marker = [[GMSMarker alloc] init];
        marker.position = CLLocationCoordinate2DMake(latitude, longitude);
        marker.appearAnimation=YES;
        marker.opacity = 0.0;
        mapView.selectedMarker = marker;
        marker.map = mapView;
        [markersArray addObject:marker];
    }
}
Run Code Online (Sandbox Code Playgroud)

和定制Infowindow:

- (UIView*)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker {
    CustomInforwindow *customView =  [[[NSBundle mainBundle] loadNibNamed:@"CustomInforwindow" owner:self options:nil] objectAtIndex:0];
    return customView;
}
Run Code Online (Sandbox Code Playgroud)

google-maps infowindow google-maps-markers ios google-maps-sdk-ios

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

Xcode无法构建IPA文件

我正在尝试通过Xcode 6.1.1构建文件IPA.但我的Xcode说:

"为帐户@"xxx"提供的密码被拒绝.请在"帐户"偏好设置面板中确保您的密码正确"

我的Xcode发生了什么?我必须更新到6.2,对吗?

xcode ios ipa xcode6

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

UITrogViewView在UITableViewCell上

我正在使用AFNetworking从我的服务器下载文件.它工作正常.但我有一个问题:当我向上或向下滚动时,我的ProgressView更新了错误的单元格(UI,而不是数据).这是我的代码:

我的细胞:

AFHTTPRequestOperation *operation;
@property (weak, nonatomic) IBOutlet DACircularProgressView *daProgressView;


- (IBAction)pressDown:(id)sender {
AFAPIEngineer *apiEngineer = [[AFAPIEngineer alloc] initWithBaseURL:[NSURL URLWithString:AF_API_HOST]];
                operation = [apiEngineer downloadFile:(CustomObject*)object withCompleteBlock:^(id result) {

                } errorBlock:^(NSError *error) {

                }];

                __weak typeof(self) weakSelf = self;
                apiEngineer.afProgressBlock = ^(double progress, double byteRead, double totalByToRead) {
                    [weakSelf.daProgressView setProgress:progress animated:YES];                    
                };
}

- (void)setDataForCell:(id)object{

}
Run Code Online (Sandbox Code Playgroud)

我的桌子:

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

            CustomCell *cell = (CustomCell*)[tableView dequeueReusableCellWithIdentifier:NSStringFromClass([CustomCell class])];
            cell.backgroundColor = [UIColor clearColor];

            CustomObject *aObject = [listObject objectAtIndex:indexPath.row];
            [cell setDataForCell: aObject];

            return …
Run Code Online (Sandbox Code Playgroud)

uitableview uiprogressview ios afnetworking-2

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