草庐IT

share-button

全部标签

ios - UIAlertViewController : Separate tint colors for cancel and other action buttons

是否可以为取消和其他操作按钮提供单独的色调颜色?目前我正在将色调颜色更改为controller.view.tintColor=[UIColorblackColor];但它也改变了取消按钮的色调。我需要为取消按钮设置不同的色调颜色,比如红色。请帮帮我。 最佳答案 按如下方式设置警报操作的颜色:UIAlertAction*cancel=[UIAlertActionactionWithTitle:@"Cancel"....[cancelsetValue:[UIColorredColor]forKey:@"titleTextColor"];

ios - iPhone SDK : Play a single WAV from a button

我目前正在试用这段代码:NSString*path=[[NSBundlemainBundle]pathForResource:@"dream"ofType:@"m4a"];AVAudioPlayer*theAudio=[[AVAudioPlayeralloc]initWithContentsOfURL:[NSURLfileURLWithPath:path]error:NULL];theAudio.delegate=self;[theAudioplay];但是,SDK表示ViewController没有实现AVAudioPlayerDelegate。有人对如何使用2.2SDK播放WAV(

ios - iOS 中的 "Fill button"动画

您对在iOS应用程序中实现以下按钮动画有什么建议吗? 最佳答案 好吧,让我们把这个动画分成几段来弄明白。1)我们需要一个白色和绿色的圆圈。2)我们需要一个刻度图像。3)我们需要为白色圆圈和勾号设置动画。第一步添加绿色UIView到你的接口(interface)文件。这将是背景View。我们不需要为这个View设置动画。然后将绿色View链接到IBOutlet像这样:IBOutletUIView*greenView;第二步在绿色里面添加一个白色的UIViewUIView并使其与绿色的大小完全相同UIView.然后链接小白UIView到

ios - 带有 UIButton : which button has been clicked? 的自定义 UITableViewCell

我正在使用最新的SDK和XCode4.2开发iOS4应用程序。我有一个包含部分和自定义UITableViewCell的UITableView。每个单元格都有一个UIButton,所有这些按钮都有相同的UIControlEventTouchUpInside目标。这是我的代码:-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{staticNSString*cellIdentifier=@"CalendarCell";CalendarEventCe

android - react native : catch volume buttons press (not for volume adjusting)

如何检测在iOS/Android上是否按下了+或-按钮? 最佳答案 我认为它对iOS有帮助..-(void)viewWillAppear:(BOOL)animated{AVAudioSession*audioSession=[AVAudioSessionsharedInstance];[audioSessionsetActive:YESerror:nil];[audioSessionaddObserver:selfforKeyPath:@"outputVolume"options:0context:nil];}-(void)obse

ios - 适用于 IOS 的 vimeo iframe 如何从 UIWebView 的右侧隐藏 "like"和 "share"按钮

我正在使用UIWebview通过此代码播放vimeo视频让embedHTML="http://player.vimeo.com/video/"+(str)!+"?title=0&byline=0&portrait=0&color=008efe&\";controls=0&fullscreen=1&buttons.share=flase&embed.buttons.like=false;autoplay=1&loop=1width=\"375\"height=\"370\"frameborder=\"0\">"我需要隐藏“分享”和“喜欢”按钮 最佳答案

c++ - shared_ptr 和 iOS 中的引用计数是同一个思路吗?

我对C++或iOS都不是很有经验,所以我很好奇iOS的引用计数在boost共享指针和NSObject中的工作原理是否基本相同? 最佳答案 据我收集here,使用ARC与使用std::shared_ptr(“强”指针)和std::weak_ptr(“弱”指针)非常相似。滥用前者,避免后者。无论如何,如果可以的话,请选择std::unique_ptr。(另外,我有点惊讶你在为iOS编程时必须手动释放指针。在21世纪。) 关于c++-shared_ptr和iOS中的引用计数是同一个思路吗?,我

iOS 8 :custom Keyboard with undo and redo button

我开发了一个IOS8自定义键盘。我想给它“撤消”和“重做”功能,就像默认的系统键盘一样。我尝试过不同的方法,但无法找到好的解决方案。我们可以使用方法与文本输入对象textDocumentProxy进行交互insertTextdeleteBackwarddocumentContextAfterInputocumentContextBeforeInput但我无法找到任何实现“撤消”和“重做”功能的方法。 最佳答案 我认为我们可以不实现这些功能(撤消、重做)根据https://developer.apple.com/library/ios

ios - UIAutomation 和 XCTestCase : how to wait for a button to activate

我正在编写一个UIAutomation测试用例,我需要等待用户被激活才能继续。似乎没有很好的方法来检查按钮是否更改为启用状态。最好的方法是等待UI中发生某些事情,然后再检查它的状态?dispatch_after和NSTimer似乎都不起作用。他们只是阻止然后失败。 最佳答案 如果您使用NSPredicates和期望值,这实际上非常容易。您甚至可以设置超时值。此示例向您展示如何使用5秒超时执行此操作。letexists=NSPredicate(format:"enabled==true")expectationForPredicate

iphone - UI 自动化 :- How to click button using javascript of a screen which is not the main screen (iPhone)?

想通过javascript点击一个按钮进行测试。我可以单击第一页上的按钮,但不知道如何单击第一页上的按钮后出现的第二页上的按钮。 最佳答案 您只需要引用第二页上的那个按钮——所以您从第一页开始重复该过程。可能,你做了这样的事情(这段代码来self使用标签栏Controller的应用程序)://NowtaptheaddbuttonvarnavBar=mainWindow.navigationBar();navBar.buttons()["Add"].tap();//Nowtheapploadsanewpage//Getthenavba