View come up on the keyboard window. How to solve it - iphone

I have list of the text filed in vertically. And all these are in one UIViewController and I am adding this UIViewController's View in my another class.
When I clicked on the text filed keyboard appears. And that scroll view comes on the keyboard window. How can i solve this. I am beginner and no idea about this problem.
Also when I open the UIPopover with date picker. And when I scroll the date picker for selecting the date the UIPopoverController also change in their layout.
Also I have attached the some screen shoot for better understanding of issue.
Got Answer
Thanks for your help. Solved my issue. In my demo code i have change some property of the UIView's Layer. For setting border, cornerRadius.
One More property i have set is "[self.view.layer setClipsToBounds:YES];". I don't know what is wrong in this but when i remove that line code just work fine.
But this property work fine with UIImageView.

Just comment below line from PaymentView.m file - (void)viewDidLoad method
[InnerView setClipsToBounds:YES];

Your question is not very clear with text,put some code.
However seeing the images in red block a suggestion could be reduce the y-axis of the y axis of your view which is coming over the keyboard.

Related

Swift: How to make view controller scroll to text field when keyboard appears

I have a view controller with 8 text fields placed vertically in the view. The problem is that the keyboard obstructs some of the text fields so that the user cannot enter any data. So, basically I need a way to scroll the view.
I did try following the approach listed in this StackOverflow question but had trouble converting some of the objective-c to Swift.
How to make the view controller scroll to text field when keyboard appears
I was wondering if anyone has solved this problem in Swift and if so could post an example?
Thanks in advance!
Hi I've resolved this problem through subclassing UIScrollView. This is a swift version of scrollView and it works with auto layout.
You can checkout here https://github.com/honghaoz/AutoKeyboardScrollView
Basically, the idea is registering keyboard notifications (e.g. UIKeyboardWillChangeFrameNotification), and scroll to let active textFields visible when keyboarding is showing.

Keyboard accessory view hiding text

I have the following problem: I have a standard UITextView which I resize once the keyboard pops up. I also have another view which I animate into view (not the standard accessory view attached to the keyboard). The problem is that I do not want text to be hidden by this view. This is what happens when I reach the last line (orange view = my custom accessory view):
Ideally, I'd like to have an automatic scroll should that happen. But I have no clue how to achieve this if I am in the last line of the UITextView. Also, scrollToVisible doesn't work in this context and I don't know if I'd get anywhere with contentInset.
Any suggestions would be welcome! Thanks.
EDIT
I suppose I would need some kind of mechanism which would allow to
make the textview only expand to the line right above the accessory view if I was entering something on the LAST LINE
have the textview expand to the keyboard if I was not editing the LINE DIRECTLY ABOVE the KEYBOARD.
Does that make sense? What I need is the opposite of contentInset, I suppose.
I simply don't want to resize the textView to just above the accessory view as it takes away screen space to display text.
I got the solution- sorry, I guess it was obvious, but it took me the whole day to figure it out:
textOfPage.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
This will offset my UITextView so that the last line is never hidden. The 100 is in pixels and can be adjusted accordingly.
What I would do is resize the textview in the textViewShouldBeginEditing method to fit above the keyboard and the newly added accessory view, and then resize it back to full screen when the keyboard is dismissed in textViewShouldEndEditing

Oritentation issue in landscape (iphone)

Good day!
I have a view which i forcefully landscape. but the problem which i am facing is that the navigation bar buttons are somewhere else but i have to click few steps (inches) back to let it act. e.g.
if button is at frame
0,0 then i have to click at 50,0 to go back. i am attaching screenshot, if some one could help me in this. Please help
Thanks & Regards
Without providing the code (or the entire project), it is unlikely for anyone to tell you exactly what is wrong.
...Unless this is just a frame/bounds issue. Make sure they are set to the proper values. The frame is the area where your view is displayed, and the bounds is the area where your view will accept interaction.
How did you force the screen in landscape? The usual way is something like the following (in any UIViewController subclass):
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
If you forced it any other way, that might be the cause of your issue.
This may cause due to no Auto resizing You will only have to do is goto Layout in Interface Builder then Live Auto resizing.
OR
By selecting all the components one by one hit cmd+3 Then there is a panel named autoresizing only select lines in inner square and deselect outer one if any
Only then your missing block will be shown and no button problem will be there
Cheers

Focus and zoom in on a UITextField when touched?

How in the world does one get the iPhone view to zoom in on a focused UITextField? I need to tap on a text field that I want to edit, and my view should zoom in to the tapped text field and pull up the keyboard (which it already does), similar to how many Internet text fields gain focus on the iPhone. Is this some type of overlay?
I've been looking everywhere for this solution but maybe I've just got the wrong terminology. Thank you in advance.
Could be a duplicate of this StackOverflow question.
In essence, there are a number of ways, but you have to program this effect manually. A textfield is already an overlay. You can either move it, or scroll the containing view.
Please follow the following steps.
Implement the delegate method for all textfield.connect the outlet of textfield in interface builder basically it's setting the delegate property.then in delegate property you can defined the method whatever you want to implement or wanted to do functionality.
Thanks

UIPageControl render quirk with UIScrollView

I'm building an iPhone application and like most I am trying to implement a UIScrollView with a UIPageControl, however I am coming across a very quirky behavior, which I assume may be a bug. Hopefully one of you has seen this before because it is driving me nuts.
Basically, the page control works fine, everything is hooked up and works normally on all accounts EXCEPT, with certain placements of the UIPageControl within the UIView, the UIPageControl will cease to render.
I'll just take screenshots of the XIB window to help illustrate... here's a placement that works perfectly fine:
http://www.jasconi.us/prob1.png
The UIPageControl is placed physically above the UIScrollView. Works great, everything is visible and working.
The next two DO NOT work:
http://www.jasconi.us/prob2.png
http://www.jasconi.us/prob3.png
The first one is simply placed below the scroll view. Doesn't render at all.
The second one is placed above the scroll view without technically being inside of it. Also doesn't render.
What the hell is up with this? I've tried using
[[self view] bringSubviewToFront:pageControl];
...to no avail.
Any ideas?
OK I found the answer to this, it's a little six degrees of Kevin Bacon.
This isn't actually a software bug, but a XIB quirk, for some reason the lower placement of the page control in combination with the default settings for autosize and anchor seem to jettison the control into outer space.
If you turn off all auto-scaling and auto-sizing and auto-anchoring and all that other crap, the controls appear exactly as you expected. The fact that it appears reliably when placed above the ScrollView is an oddity.
shrug.
Hope this helps future iPhone initiates.
Did you check to make sure that numberOfPages is not 0?
If you set a breakpoint can you see that pageControl is not nil?
I was still encountering this exact same problem, even after trying everyone's posted answers. My issue ended up being a little more "DOH":
I was using UIPageControl at the bottom of a modal FormSheet, however, I forgot to set the size of the view as Form Sheet in the xib. This caused my page control to be off the screen and never visible.
Moral: set view size (Full, Form, Page, etc) in your xib on the base view.
This will sound like a real no brainer, but I got caught out by it.
By default, UIPageControl expects to be on a dark background. IE: The dots are light gray, and white for the current page.
I used UIPageControl on it's own with no scrollview to change the time range of a graph I was rendering with drawRect:
Long story short, the graph background was white, so the page controller worked, I just couldn't see it. The solution was putting the graph itself in a subview, and making the parent that contained the page control have a dark background.