- Posts: 261
- Thank you received: 18
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about iOS development and PDF
error when toggling between portrait and landscape mode
IP: 37.183.44.177
7 years 9 months ago #13957
by federico
Replied by federico on topic error when toggling between portrait and landscape mode
Hi,
To keep on focus your text field I suggest you to check the filedType in OnAnnotClicked method in RDPDFViewController class:
And so in shouldAutorotateToInterfaceOrientation method:
So you could simulate a tap in your textField.
To keep on focus your text field I suggest you to check the filedType in OnAnnotClicked method in RDPDFViewController class:
Code:
if (annot.fieldType == 1)
{
currX = x;
currY = y;
}
Code:
if (![textFd.text isEqual: @""]){
[m_view setEditBoxWithText:textFd.text];
[self OnSingleTapped:currX :currY];
}
IP: 47.44.172.50
7 years 9 months ago #13960
by pooja
Replied by pooja on topic error when toggling between portrait and landscape mode
Hi, I tried these changes but it still doesn't work.
IP: 212.97.62.176
7 years 8 months ago #13965
by emanuele
Replied by emanuele on topic error when toggling between portrait and landscape mode
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:
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:
Code:
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]];
Time to create page: 0.346 seconds