What is alternative to use customised alert views in ios7? - ios6

in ios6 I had UITextfield placed on UIAlertview to take inputs from user.
but in ios7 it don't seem to be working.
Any idea how to achieve that in ios7?
Thanks,
Virat

For the same task I'm creating UIView subclasses that I add as subviews to the main window. This way they will appear on top of everything and I'm in control of the layout & functionality.

Related

Extjs best practice of communication between several ViewControllers and Views

The question is, how to build a common application using extjs5 where within the west region I have a treepanel and within the center region I want to add panels depending on the treepanel items click. The panels should go in separate files and should have it's own ViewControllers in separate files also. Regions are in a viewport. The viewport has it's own MainViewController.
I've tried to get a ViewController from MainViewController, but unfortunately I didn't find the right solution.
I've also tried instead of several ViewControllers create common Controllers and call their methods from MainViewController like this:
MyApp.app.getController('ConnectionController').showPanel();
but i can't get an idea how to get a View from it's Controller - all of the bellow return undefined:
console.log(Ext.ComponentQuery.query('#connection')[0]);
console.log(Ext.getCmp('connection'));
console.log(this.lookupReference('connection'));
After all I decided it is a wrong communication model. Any suggestions will be appreciated.
I've finally figured it out. To make a communication between MainViewController and Panels it is possible to create already defined panel from view controller like this:
var panelToAddName = Ext.create('MyApp.view.Panel1View', {});

Push heavy UIViewController with many UIButtons to UINavigationController

I have a UIViewController with a lot of UIButtons (each with a custom UIImage), and when I push that UIViewController to the UINavigationController, it does not show a smooth animation.
So basically same problem as here: Low frame rate during UINavigationController push transition
But I don't want to hide my UIButtons during the animation, I want something like what they do in this game
which is not "laggy".
How can I do that?
Thank you.
If you want to achieve the view which is similar to the one in the itunes link which you have provided then I dont see the use of lot of UIButtons. As adding too many UIButtons will make the view heavy.
Replace UIButtons with CALayer, as CALayer is light weight compare to UIButtons.
You can make use of 'name' property of CALayer to give unique name to each layer and override the hitTest method to get the layer which you tap and achieve the same functionality as UIButton.

Animating a view created in IB using Autolayout

I have a view with a lot of labels and buttons which are created on code because in IB is too complicated. This works ok.
In IB I also created an input view which I want to appear from the bottom by the tap on a button. Very much like a keyboard if you will. Because this input view is strigth forward, it has been created on IB and it contains sliders, labels, etc. I haven't added it as a subview of self.view on IB.
By the tap of the button, I set up all the constrains for the input view: I set the width, I set it on the bottom of the self.view with vertical size, then I remove this constraint, I add the actual heigth and then I animate with [self.view layoutIfNeeded].
The thing is that the input view itsef animates correctly, but its subviews not so much. They kind of appear at once.
I have tried adding a input view programmatically, with only one switch. It animates quite nicely.
I'm guessing that there is a problem with the constrains between the controls and their superView. But I'm not sure about it, because although they do not animate correctly, they are on the correct place and witht the correct proportions. I guess I'm missing something here. Maybe it's not a good idea to mix IB set controls and views and programmatically modifying them?
Does somebody have any experience with that?
Thanks in advance,
I suggest you post to Apple's dev boards on this subject. I've seen several posts there recently. The Apple Engineers who replied said that with Autolayout, you basically give autolayout ownership of your view's center, size, and sometimes, transform.
To animate views that use autolayout, you should apparently use UIView block animation and animate the constraint settings on the views. The system will then animate the changes you make.
Not sure about adding new views programmatically and having them animate into place however.

How to make WPF page navigation code look better?

I want to make a program by WPF which includes several pages.
I have a Window and several Pages now.
In order to navigate, I use
this.Content = new Page1();
in the main window (from Window to Page), and
((Window)this.Parent).Content = new Page1();
between pages (from Page to Page), because Page can only be sub-element of Window or Frame.
However, the second line of code above looks quite ugly.
Is there a better way to achieve the same goal?
I have coded from several Windows Phone applications before, and I think it might be better to navigate between Pages rather than hide/show elements (such as Grids).
If your navigation code is on your Page class, either :
move it to the window class
create an event in the Page class, and react to it on the Window class.
Is there any reason why you can't just put a Frame in your Window ?
You could use NavigationService.
http://msdn.microsoft.com/en-us/library/ms750478.aspx
http://www.paulstovell.com/wpf-navigation
Maybe this could help:
http://azerdark.wordpress.com/2010/04/23/multi-page-application-in-wpf/

WinForms "mini-windows"

I need to create some mini-windows, like the ones shown in the image bellow, in my winform main form.
It would be nice if they could be draggable, resizable, and, mainly, closable.
How can I approach this design? Has anybody already seen some control (with code available) implementing something similar?
alt text http://img716.imageshack.us/img716/5765/imagea.png
A normal Form works fine for this. Set its FormBorderStyle to either FixedToolWindow or SizableToolWindow as desired.
If you want to keep your floating windows inside your main window, use MDI (Multiple Document Interface). Here is a tutorial (Google can find you many more).
Have you tried just setting the FormBorderStyle property to SizeableToolWindow?
Is that what you're after?
You can create them as resizable and draggable custom controls.
You could use my example at:
http://hourlyapps.blogspot.com/2008/07/resizable-and-movable-controls-c-net.html

Resources