error when toggling between portrait and landscape mode - Page 3 - RadaeePDF.com - Results from #12
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
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 5 months 2 weeks ago #13957

  • federico
  • federico's Avatar
  • Online
  • Moderator
  • Moderator
  • Posts: 59
  • 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 5 months 1 week 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 5 months 1 week ago #13965

  • emanuele
  • emanuele's Avatar
  • Online
  • Moderator
  • Moderator
  • Posts: 526
  • Karma: 20
  • Thank you received: 60
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