Autolayout uitextfield content vertical alignment center - iphone

I am using autolayout, I have put constraints on textfield such as same width, same height bottom alignment left and right align to certain controls. My problem is that I am not able to do content vertically alignment center. I tried both from xib and coding but it is not working and comes aligned to top. I am using xcode5. These problem occurs in any ios(I am basically developing from ios6 to ios 7). Please help.

Related

How to center a view in storyboard?

I'm trying to center the view (see attached) in StoryBoard in Xcode. I tried ticking the box where it says Horizontally in Container. I also set the width and height, but the view is not getting centered. Can someone please help? It's centered in IPhone 8 but not IPhoneXR.

custom keyboard UITextField inputView xcode

I am adding a custom keyboard to a view using inputView linked to a UITextField. I have set the size at Width 216, Height 320. I have it entering from the bottom on a portrait orientation. I want it to only cover 216 pixels of the screen but now when it comes up with the keyboard hugging the left side and has the correct aspect ratio. However there is a gray background that extends from the right edge of the keyboard to the right side of the view. Is there any way to remove this so it is clear and I can see the right side of the view? I have tried setting the background of the view to clear color and tried everything I can think of. Does anyone know if this is possible?
I guess you can't do it, because with keyboard opening the view moves up, so there are the "empty" rectangle in the 216x320 pts.

Xcode not respecting the constraints on my iphone xib file

I am having problems figuring out why Xcode is not respecting the constraints on my iphone xib file.
This is how I set a button in the xib file:
and this is how it appears in the simulator:
and this is how it appears in the simulator:
I defined the size of the button:
Any of you know what I'm doing wrong?
I'll really appreciate your help.
If you want the button to stay at the center of the view, you just need two constraints.
vertically center in container
horizontally center in container
Add this two and get rid of the vertical space containers.
Don`t no much about constraint but u can remove it with Doing uncheck in AutoLayout in property editor.
And than palce your button and make it center horizontal and center vertical from property editor of xib.
And make all bounds pack in AutoSizing given in property editor.

iPhone 4 to iPhone 5 - toolbar doesn't move to the bottom

I have an app that is designed for the iPhone 4. This app has a toolbar that was drag-dropped in Interface Builder to the bottom of the screen. When testing on simulator's iPhone 5 "device", the toolbar does NOT automatically go to the bottom of the screen.
My question is - is there some kind of a trick or technique, that will let all the UITables "stretch" to populate all the new available space, and toolbars go to the bottom no matter what kind iPhone it is being connected to? It would be painful, to do this programmatically - that is figure out what kind of an iPhone I am and then, programmatically reposition all the ui. If this is in fact a must, should any new iPhone apps be designed for 4" retina, and then programmatically shrink everything for iPhone 4 size, or is it better to design for 3.5", and then stretch and push down toolbars in case it is an iPhone 5 with 4" screen.
Thanks for any input..
If you are only using iOS 6, the easiest method would be to use Auto Layout and add a constraint in Interface Builder. The constraint would describe that the toolbar's bottom edge should be equal to the superview's bottom edge. You don't have to code specifically for a single device. To have the UITableView stretch to fill all the available space, again I would recommend using constraints on the UIScrollView (not UITableView, which sits inside the scroll view) to describe this behavior, e.g. The scroll view's top edge should equal the superview's top, left edge should equal the superview's left, bottom edge should equal the UIToolbar's top (In IB, a spacing constraint specifying that the spacing between the UIToolbar and the UIScrollView should equal 0), and right edge should equal the superview's edge.
If you can't use constraints, this behavior is specified using the struts and springs system that utilizes the autoresizingMask property on the view that specifies that the UITableView's parent-UIScrollView has a flexible width and height and the UIToolbar has a fixed height and a flexible with. You would manually position the UIScrollView and UIToolbar by setting their respective frame property that describes the x,y coordinates of the top-left edge as well as the width and height of the view.
View Programming Guide for iOS - Adjusting the Size and Position of Views at Runtime
Cocoa Auto Layout Guide: About Cocoa Auto Layout

starting text in uitextview from center both horizontally and vertically

I want to begin text entered into UItextview from center both horizontally and vertically, please some one help me.
set Alignment as center.for that select the textfield from .xib class and go to the library and in that set Alognment as center.