error when toggling between portrait and landscape mode - Page 3 - RadaeePDF.com - Results from #12
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
01 Jun 2018
During last few days we're experiencing some delay in website stmp provider channel.
Some notification email from the website might not reaching containers.
We're working on a definitive solution.
Read More...
Questions about iOS development and PDF

TOPIC: error when toggling between portrait and landscape mode

error when toggling between portrait and landscape mode 1 week 5 days ago #13957

  • federico
  • federico's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 46
  • Thank you received: 4
Hi,
To keep on focus your text field I suggest you to check the filedType in OnAnnotClicked method in RDPDFViewController class:
if (annot.fieldType == 1)
    {
        currX = x;
        currY = y;
    }
And so in shouldAutorotateToInterfaceOrientation method:
if (![textFd.text isEqual: @""]){
        [m_view setEditBoxWithText:textFd.text];
        [self OnSingleTapped:currX :currY];
    }
So you could simulate a tap in your textField.

Please Log in or Create an account to join the conversation.

error when toggling between portrait and landscape mode 1 week 3 days ago #13960

  • pooja
  • pooja's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 0
Hi, I tried these changes but it still doesn't work.

Please Log in or Create an account to join the conversation.

error when toggling between portrait and landscape mode 6 days 21 hours ago #13965

  • emanuele
  • emanuele's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 501
  • Karma: 15
  • Thank you received: 55
Hi,

on rotation event the page is re-rendered, so you lose the current annotation instance.
You can get the annotation index when you tap on it the first time (add [m_annot getIndex], in PDFView class when the annotation is tapped), then get the same annotation after the rotation using the index.

In PDFView class you can add a method to force the OnAnnotEditBox with something like:
m_annot = [page annotAtIndex:index];
[m_annot getRect:&m_annot_rect];
                    
annotRect.origin.x = m_annot_rect.left / m_scale;
annotRect.origin.y = m_annot_rect.top / m_scale;
annotRect.size.width = (m_annot_rect.right - m_annot_rect.left)/m_scale;
annotRect.size.height = (m_annot_rect.bottom - m_annot_rect.top)/m_scale;
[m_delegate OnAnnotEditBox :annotRect : nuri :([m_annot getEditTextSize]/m_scale) * [m_view vGetScale]];

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum