将UIButton作为子视图添加到UITabBar

我正试图在我的应用程序中实现一个隐藏的UITabBar。 我制作了所有的animation,效果非常好。 我只是有一个问题,让我的UIButton“拉标签”显示标签栏。 它不响应触摸事件UIControlEventTouchUpInside。 我把这个pull标签添加到UITabBarController的UITabBar中: – (void)viewDidLoad { [super viewDidLoad]; //Add pull pullButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *image = [UIImage imageNamed:@"TabBarPull.png"]; pullButton.frame = CGRectMake(self.tabBar.frame.size.width – image.size.width, -image.size.height + 3, image.size.width, image.size.height); [pullButton setImage:image forState:UIControlStateNormal]; [pullButton addTarget:self action:@selector(pullBarTapped:) forControlEvents:UIControlEventTouchUpInside]; pullButton.userInteractionEnabled = YES; [self.tabBar addSubview:pullButton]; } 这是标签栏看起来像打开和closures的内容: 编辑:我已经确定,问题是因为button不在UITabBar的框架。 看起来我将不得不把button放在UITabBar之外…animation噩梦。

如何编辑UIAlertAction文本的字体大小和颜色

如何编辑UIAlertAction文字大小和颜色? 我已经采取了一个UIAlertController如何编辑大小。 这我smy代码 UIAlertController *controller = [UIAlertController alertControllerWithTitle:@"Do you wish to logout?" message:@"" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *logOut = [UIAlertAction actionWithTitle:@"Log Out" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {}]; 现在我想要我的“注销”字体大小为22,绿色,半色的文本。

iOS谷歌地图sdk GMSMarker定位

我正在使用谷歌地图,我可以通过使用中心地图到GMSMarker GMSCameraPosition *camera = [[GMSCameraPosition alloc] initWithTarget:marker.position zoom:MAP_ZOOM_LEVEL bearing:0 viewingAngle:0]; [mapView animateToCameraPosition:camera]; 我正在显示尺寸为200 * 150的自定义标注,当相机位置发生变化时,其中一部分会隐藏起来,但我希望标注位于中心,地图点位于其下方。 任何想法如何做到这一点。

UISearchController禁用取消UIBarButtonItem

问题 我正在尝试使用UISearchController在地图视图上search目的地。 我想UISearchBar出现在导航栏中,但我似乎无法做到这一点,没有它显示右边的取消button: 这个取消button有时会消失,虽然我在玩,但我不能得到它现在没有出现我已经得到了search表显示我希望它: 我敢肯定,我一直在做一些小小的事情,但是我搞不清楚它是什么… 我的代码 self.resultsViewController = [UITableViewController new]; self.searchController = [[UISearchController alloc] initWithSearchResultsController:self.resultsViewController]; self.searchController.searchResultsUpdater = self; self.searchController.hidesNavigationBarDuringPresentation = false; self.searchController.delegate = self; self.searchBar = self.searchController.searchBar; self.searchBar.placeholder = self.stage.title; self.searchBar.searchBarStyle = UISearchBarStyleMinimal; self.definesPresentationContext = true; self.navigationItem.titleView = self.searchBar; self.resultsTableView = self.resultsViewController.tableView; self.resultsTableView.dataSource = self; self.resultsTableView.delegate = self;

架构armv7的未定义符号:“_SCNetworkReachabilityCreateWithAddress”

对,这已经成为一个正确的痛苦,我已经看了2天,似乎无法解决它。 这是我得到的错误。 Undefined symbols for architecture armv7: "_SCNetworkReachabilityCreateWithAddress", referenced from: +[Reachability reachabilityWithAddress:] in Reachability.o "_SCNetworkReachabilityCreateWithName", referenced from: +[Reachability reachabilityWithHostName:] in Reachability.o "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: -[Reachability stopNotifier] in Reachability.o "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: -[Reachability startNotifier] in Reachability.o "_SCNetworkReachabilitySetCallback", referenced from: -[Reachability startNotifier] in Reachability.o "_SCNetworkReachabilityGetFlags", referenced from: -[Reachability connectionRequired] in Reachability.o -[Reachability currentReachabilityStatus] in Reachability.o ld: symbol(s) […]

应用程序加载和初始屏幕

我的应用程序下载相当多的数据,这需要几秒钟。 我的启animation面显示,然后消失,然后在加载第一个视图之前出现白色的空白屏幕几秒钟。 有没有办法保持启animation面出现? 在AppDelegate中创build一个视图并保持显示状态,直到所有的数据加载完成并且视图即将加载为止。

在iOS中阅读短信

我是一个iOS开发人员,我试图build立一个自动激活function的移动应用程序,我发现更多的方式来阅读短信,但只使用私人的API,这将导致苹果拒绝我的应用程序。,我有两个问题,欣赏任何反馈都可以帮助我。 1-有没有办法在iOS平台上阅读短信,而不面临苹果拒绝? 2-可以有人提供我在苹果开发者文档中的相关部分,描述它不允许在iOS平台上阅读短信的部分?

UIControlState.Normal不可用

以前对于UIButton实例,您可以在UIControlState.Normal传递setTitle或setImage 。 .Normal不再可用,应该使用什么? let btn = UIButton(frame: CGRect(x: 0, y: 0, width: 20, height: 20)) btn.setTitle("title", for: .Normal) // does not compile (这是一个规范的问答对,以防止与iOS 10和Swift 3相关的UIButton和UIControl更改相关的重复问题泛滥)

如何打印出(NSLog)添加到NSMutableArray的自定义对象的属性

我有一个自定义的对象,我用它定义了3个属性。 我创build该对象并将值分配给这些属性。 之后,我把这个对象放入一个NSMutable Array 。 我知道我可以使用: for (id obj in personArray) { NSLog(@"obj: %@", obj); } NSLog(@"%@", personArray); 告诉我在我的数组中有什么样的对象。 但是我想深入一个层次,我希望能够看到每个对象的属性。 我只是不知道如何瞄准他们。 这里是代码,我正在使用:人是我的自定义对象。 personObject = [[Person alloc]init]; [personObject setFirstName:firstName.text]; [personObject setLastName:lastName.text]; [personObject setEmail:emailAddress.text]; // add the person object to the array // the array was alloc and init in a method above this code. [personArray addObject:personObject]; […]

从短信链接或电子邮件链接启动应用程序

我有要求启动一个应用程序时,短信或电子邮件链接被遵循。 我已经阅读了关于URLscheme,已经testing,它的工作原理,但问题是,如果应用程序没有安装在设备上什么都不会发生。 我需要一种方式来打开一个url,如果应用程序没有安装,但我找不到这样做的方式… 任何想法? 谢谢