我想实现UIAlertViewController这样的(参考:Pages和Keynote应用程序):
我已经实现了一个自定义的tableview,并通过模仿来呈现视图UIAlertViewController.但我无法实现与上面类似的用户界面.有没有可用的默认控制器?
-(void)share:(id)sender
{
[self setModalPresentationStyle:UIModalPresentationCurrentContext];
AlertViewController *renameCntrl = [self.storyboard instantiateViewControllerWithIdentifier:AlertTblViewidentifier];
renameCntrl.optionViewDelegate = self;
renameCntrl.providesPresentationContextTransitionStyle = YES;
renameCntrl.definesPresentationContext = YES;
[renameCntrl setModalPresentationStyle:UIModalPresentationOverCurrentContext];
[self presentViewController:renameCntrl animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud) 我试过了
@implementation UITextField (DisableCopyPaste)
-(BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
return NO;
return [super canPerformAction:action withSender:sender];
}
@end
Run Code Online (Sandbox Code Playgroud)
但它禁用所有文本字段的复制/粘贴选项,如何禁用特定文本字段的菜单选项.
我已经给了一个文本 mytts.speak("hi hello hi",parameter,parameter...);
但是这些词语不断地说没有任何间隙或停顿,我想在单词之间提供一些时间间隔以便更清晰.
我怎么能实现这个目标?
您好,我想在编辑模式下禁用 uicollectionview 的第一个单元格。我在 cellforrow 中执行了以下代码
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
MainCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];
cell.curveimageView.image = nil;
if(indexPath.item == 0){
[cell.curveimageView setImage:[UIImage imageNamed:@"AddCell"]];
cell.subTitleText.text = @"New Cell";
if(isEditing){
[cell setUserInteractionEnabled:NO];
[cell setAlpha:0.5];
}
else{
[cell setUserInteractionEnabled:YES];
[cell setAlpha:1];
}
}
else{
[cell.curveimageView setImage:[UIImage imageNamed:@"FlowerImage"]];
cell.subTitleText.text = [NSString stringWithFormat:@"%ld%@",(long)indexPath.row,@"Hello is this looking ok"];
}
[cell setTag:indexPath.row];
return cell;
}
Run Code Online (Sandbox Code Playgroud)
第一次在编辑模式下,我能够让用户单击所有单元格,但滚动后,第一行中的少数单元格会以随机方式禁用。任何人都可以建议我解决此问题的解决方案。
谢谢