ios - UITextView inside a UIScrollView inside a Popover is not fully visible when keyboard is displayed -


i have uipopover uiscrollviewinside contains uitextview @ bottom. when keyboard shows, popover resized text view begins edited. want code below ensure text view visible:

- (void)textviewdidbeginediting:(uitextview *)textview {      cgrect visrect = textview.frame;     [self.scrollview scrollrecttovisible:visrect animated:no];  } 

the problem code not make entire text view visible. instead, text view bottom of cursor shown, shown below:

enter image description here

how can show entire text view/ scroll scrollview bottom? have tried this:

cgpoint bottomoffset = cgpointmake(0, self.scrollview.contentsize.height - self.scrollview.bounds.size.height); [self.scrollview setcontentoffset:bottomoffset animated:yes]; 

as explained in answer nothing works.

in addition, scrollview scrolled position shown after keyboard moved place. ideally i'd scrolling happen before or during keyboard movement.

any great.

@hey dave

this default case in of uipopovercontroller, whenever used uipopovercontroler display popupview , in suppose popupview height large can covered keyboard in case popoverview automatically gets shrink itself.as resign keyboard popupview expand automatically.i have faced same case.

this opinion , can change origin of currentview(parentview of popupview) keyboard going display/hide popupview display , appropriate space.

see below delegate methods of uitextview responds editing start , end.

- (bool)textviewshouldbeginediting:(uitextview *)textview {  //chnage originy of popupview's superview } - (void)textviewdidbeginediting:(uitextview *)textview {    //re adjust originy of popupview's superview } 

i hope may helpful you.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -