uiviewcontroller

Animation iOS with sound file

懵懂的女人 提交于 2019-12-30 07:39:46
问题 I have some animation which needs to appear on screen at very specific timings, these are stored in SQLite database. What I am planning to do is use nstimer to keep time and pop the animation when the specific time is reached. Im thinking of using an NSTimer to count for the duration of the sound file and animation then when certain points are reached pop an on screen animation. The problem is the set timing are like this 55.715000 seconds so are very accurate and these need to sync with an

XAMARIN.IOS UITabBarController in some UIViewControllers

点点圈 提交于 2019-12-30 07:15:13
问题 I have an application (Xamarin.IOS) which start with a UIViewController (Connection view) with no TabBar. But when user Logged, I'd like to add the tabbar that I've created to other views. And vis-versa, when user logged out, I'd like to display the connection view without TabBar. I know that when I want to display the TabBar, in appDelegate, I have to initialize _window like this : _tabController = new TabController(); _window.RootViewController = _tabController; _window.MakeKeyAndVisible();

why is my UIView subview not rendering within the parent? (code attached)

谁说我不能喝 提交于 2019-12-30 05:45:06
问题 Why is my custom UIView not rendering within the UIView container of it's parent? So what I have is: MainViewController - has a UIView " customViewContainer " (which doesn't take up the whole screen), and CustomView - is a UIView with a XIB file - it is the UIView here that when it is rendered (with AspectFit) is rendering outside the bounds of the parent " customViewContainer " The code used to setup the custom view is this extract from MainViewController: << cut - see Update2 below >> So I

Pass a variable between lots of UIVIewControllers

白昼怎懂夜的黑 提交于 2019-12-30 04:36:12
问题 In my iPhone app, there is a setup assistant which helps users to input a lot of data. It's basically a UINavigationController with lots of UIViewControllers in it. Now, at a certain point, I want to access a variable that the user entered in the first UIViewController he saw. I could pass the variable between every UIViewController with a setter method, but I guess there is an easier way. 回答1: You can declare global or class variables in C style if you want to. If you want the same variable

View rotation notifications: why didRotateFromInterfaceOrientation: doesn't get called?

一曲冷凌霜 提交于 2019-12-30 04:00:07
问题 I'm trying to detect any device orientation change so that I can update the views. I want to update the views whether the orientation is portrait or landscape, so I implemented this method: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations. return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation ==

present and dismiss UIViewController with completion blocks - without protocols and delegates

蹲街弑〆低调 提交于 2019-12-30 03:33:08
问题 I would like to present an instance of VC2 from an instance of VC1 and pass it a completion block to be executed when the VC2 dismisses itself. The passed completion block will be a method call on the VC1 instance. What would be the correct way of doing this? While presenting VC2 from VC1 normally is: VC2 *vc2 = [[VC2 alloc] init]; [self presentViewController:vc2 animated:YES completion: nil]; and in VC2 [self dismissViewControllerAnimated:YES completion: nil]; (ps normally I would dismiss

iPhone subview design (UIView vs UIViewController)

♀尐吖头ヾ 提交于 2019-12-30 03:26:06
问题 I'm designing a simple Quiz application. The application needs to display different types of QuizQuestions. Each type of QuizQuestion has a distinct behavior and UI. The user interface will be something like this: alt text http://dl.getdropbox.com/u/907284/Picture%201.png I would like to be able to design each type of QuizQuestion in Interface Builder. For example, a MultipleChoiceQuizQuestion would look like this: alt text http://dl.getdropbox.com/u/907284/Picture%202.png Originally, I

How do I override the “view” property in UIViewController?

五迷三道 提交于 2019-12-30 01:37:47
问题 I have a custom UIViewController and custom UIView. I'd like to override the viewcontroller.view property to return MyCustomUIView. Right now I have: @interface MyViewController : UIViewController { IBOutlet MyView* view; } @property (nonatomic, retain) IBOutlet MyView* view; This compiles but I get a warning: property 'view' type does not match super class 'UIViewController' property type. How do I alleviate this warning? 回答1: The short answer is that you don't. The reason is that properties

How to go to second view controller after click on disclosure indicator button

[亡魂溺海] 提交于 2019-12-29 09:34:36
问题 I would like to remove existing annotation from mapview. Scenerio is to click on existing annotation callout part (disclosureindicator button) and it would lead user to another viewcontroller and shows a button you could remove the selected annotation. Actually, I am working on to create exactly same google map application, that is part I am struggling now. Any help would be appreciated! 回答1: The MKMapView class has two methods you need to add/remove annotations: addAnnotation: id

how to instantiate ViewController from UIView in SWIFT

丶灬走出姿态 提交于 2019-12-29 09:34:12
问题 I am trying to initialize view controller from my UiView. But i am getting error on the line self.presentViewController(vc, animated: true, completion: nil) . I am trying to show another view controller after click on a table row. i have already initialized storyboard. import UIKit class CustomSwipeOut: UIView , UITableViewDataSource , UITableViewDelegate { var label: UILabel = UILabel() var myNames = ["item1","item2","item3"] override init(frame: CGRect) { super.init(frame: frame) self