When PDF viewer is added to a StackLayout in Xamarin.Forms, it works as expected in Android platform. But in iOS and UWP, the PDF viewer is not visible. This is true regardless of whether the PDF viewer is an immediate child of StackLayout or the StackLayout is at a higher level of parent hierarchy. This is due to the default behavior of StackLayout that it does not show the entire contents of its child if the child’s size is not defined.
To make the PdfViewer visible in both iOS and UWP, the HorizontalOptions (if the orientation of the StackLayout is horizontal) or VerticalOptions (if the orientation of the StackLayout is vertical) of the immediate child of the StackLayout must be set to “FillAndExpand”.
If the PDF viewer is an immediate child to a StackLayout, set the HorizontalOptions or VerticalOptions of the PDF viewer to “FillAndExpand”. For example, the vertical orientation is used in the following code.
If the PDF viewer is at lower level in the child hierarchy of a StackLayout, set the VerticalOptions or HorizontalOptions of the immediate child of the StackLayout to “FillAndExpand”. For example, horizontal orientation is used in the following code.
This page will automatically be redirected to the sign-in page in 10 seconds.