Tag: select器

Xcode:只在默认状态下设置button的图像,而不是select

我是一般的Xcode和iPhone编程的新手..我有一个简单的问题,这个问题我..我想设置一个button上的图像,因为它的默认状态。 所以我selectbutton,并在“显示属性检查器”选项卡中,我select“状态configuration”为默认,然后我find所需的图像在“图像”下拉列表中… 问题: 我将“状态configuration”更改为选中,图像仍然打开。 我需要图像只在默认状态。 我有同样的问题,如果我想在默认和select状态标题文本不同的字体大小。 我正在使用Xcode 4.6并为iOS 6.1编写代码。

如何使UITextView文本全部可选,并向用户iPhone应用程序显示复制选项?

我在iPhone应用程序,如iMessage原生应用程序工作。 我devise了一个页面看起来像iMessage也添加了气泡。 我做的是,只是UITextView in UITableView Cell and also i have added UIImageView on UITextView with bubble images添加一个UITextView in UITableView Cell and also i have added UIImageView on UITextView with bubble images 。 从NSMutableArray加载文本到UITextView。 它工作正常。 现在我的疑问是: 在iMessage应用程序,他们设置, when the user hold the bubble they making the text as selectable and showing Copy option 。 在我的应用程序, when […]

在选定的UIButton上单击时突出显示的UIButton状态

当我点击已经select的button时,我想让我的UIButton显示突出显示的状态。 基本上在突出显示的状态,我应用一个* .png图像作为我的UIButton backgroundImage给予按下的效果。 但是,如果button已经在选定的状态当我再次点击它,我只是看不到突出显示的状态,但它直接进入正常状态! 观看问题 – >问题的 video! 请帮助 //0 init UIButton UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x, y, aSide, aSide)]; //1 Give it a backgroundColor [button setBackgroundColor:aColor]; [..] //2 Set titleLabel and its style [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [button setTitleColor:[UIColor redColor] forState:UIControlStateSelected]; [button setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted]; UIImage *shadowImage = [UIImage imageNamed:kBtnShadow]; shadowImage = […]

SQLite错误:复合SELECT中的术语太多

当我将太多的数据插入到sqlite数据库文件时,会出现错误“复合SELECT中的词条太多”。 我使用“ insert into … select … union select … union … ”。 我知道这是太多的select语句,但我的问题是:复合SELECT语句中的最大数量是多less?

select器作为IOS中的参数

我想为每个创build的button提出一个不同的方法。 我尝试在viewDidLoad中调用“FirstImage”方法,但它不起作用。 我在ViewDidLoad中的select器有问题。 没有认出“FirstImage”这是一个没有参数的void方法。 ViewController.m – (void)createFirstButton:(NSString *)myName: (SEL *)myAction{ UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [btn addTarget:self action:@selector(myAction) forControlEvents:UIControlEventTouchUpInside]; [btn setTitle:myName forState:UIControlStateNormal]; btn.frame = CGRectMake(20, 916, 120, 68); [self.view addSubview:btn]; } – (void)viewDidLoad{ [self createFirstButton:@"First" myAction:[self FirstImage]]; } 我做了什么(我把“CreateFirstButton”改成了“CreateButton”): ViewControler.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize myHeight; @synthesize myWidth; @synthesize myX; @synthesize […]

NSURLSession dataTaskForRequest:完成:发送给实例的无法识别的select器

当试图创build我自己的会话对象NSURLSession()和请求一个URL我得到一个无法识别的select器exception,但是当我使用共享会话NSURLSession.sharedSession()一切工作正常。 怎么来的? var url = NSURL(string: "http:/www.google.com") if url != nil { //throws unrecognized selector when dataTaskWithURL is called let session=NSURLSession() session.dataTaskWithURL(url!) //works let sharedSession=NSURLSession.sharedSession() sharedSession.dataTaskWithURL(url!) }

崩溃在集合视图的performBatchUpdates

我有一个集合视图显示两个不同的图像数量的数组这将是一个collectionview视图的两个不同的视图之间切换 – (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { if (self.storyview) { return 4; } else { return 1; } } 我在哪里执行收集视图的批量更新。 它正在坠毁,因为我有两个段数 [self.collectionView performBatchUpdates:^{ NSRange range = NSMakeRange(0, [self.collectionView numberOfSections]); NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:range]; [self.collectionView deleteSections:indexSet]; [self.collectionView insertSections:indexSet]; } completion:^(BOOL finished) { [self.collectionView reloadData]; }]; 我的崩溃日志如下: Assertion failure in -[UICollectionView _endItemAnimations], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UICollectionView.m:3901 Terminating app due to uncaught […]

无法识别的select器发送到实例(iOS)

可能重复: 无法识别的select器发送到实例 那么…像其他许多人一样,我得到了一个“无法识别的select器发送到实例”错误… 当我按下button时会出现问题,例如在这种情况下: -(IBAction)gotoTone:(id)sender { if(self.tone == nil) { Tone *toneMain = [[Tone alloc] initWithNibName:@"Tone" bundle:[NSBundle mainBundle]]; self.tone = toneMain; [toneMain release]; } [self.navigationController pushViewController:tone animated:YES]; } 错误是:终止应用程序由于未捕获的exception“NSInvalidArgumentException”,原因:' – [音调gotoTone:]:无法识别的select器发送到实例0x531caa0' 我插入一个新的视图作为第一个视图呈现给用户后,开始发生错误…此外,我使用导航栏,并开始我忘记进入MainWindow.xib并将导航控制器更改为新的视图,但现在是固定的。 你可以看到我的整个代码: 发生该文件的.h文件: http ://snipt.org/xnoO文件发生的.m文件: http : //snipt.org/xnoM 不要介意所有的评论线,只是直到我得到这个固定的… 我试着find一个解决scheme,通过阅读“无法识别的select器发送到实例”的其他情况,但我想我只是没有看到解决scheme。 我已经检查了我的IB连接,我已经清理了这个项目,等等… 任何帮助将不胜感激

努力将Objective Cselect器和目标签名转换为Swift

美好的一天, 我正在尝试将Objective C片段转换为Swift。 我明白select器可以通过放置在一个string直接翻译,但我不明白的Objective C签名: Objectice Cselect器(第二个参数): UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); 目标: – (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{ 我的问题是:1.我可以简单地通过select器: UIImageWriteToSavedPhotosAlbum(image, self, "image:didFinishSavingWithError:contextInfo:", nil); 请帮助我的目标function的singnature。 我很难过!

如何更改select框背景,而不会丢失移动Safari上的右箭头

我需要将我的select框的背景更改为平坦的颜色,但我不想让右箭头(aka下拉箭头)消失。 我努力了: select { -webkit-appearance: none; border: 0; background: none; } 这适用于所有浏览器,除了iOS 7的iPhone 4s上的Safari。在此浏览器上,右箭头消失,用户不清楚它是否是select框。 省略-webkit外观没有帮助。 我不想做一个假箭头。 这将影响所有其他浏览器。 有任何想法吗?