我正在使用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
我正在尝试从视频中获取缩略图并在我的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)
但是图像总是回归黑色.怎么了?
我正在尝试创建标记而不需要点击.但我不能显示所有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
我正在尝试通过Xcode 6.1.1构建文件IPA.但我的Xcode说:
"为帐户@"xxx"提供的密码被拒绝.请在"帐户"偏好设置面板中确保您的密码正确"
我的Xcode发生了什么?我必须更新到6.2,对吗?
我正在使用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) ios ×4
google-maps ×1
image ×1
infowindow ×1
ios8 ×1
ipa ×1
ipad ×1
uitableview ×1
xcode ×1
xcode6 ×1