Posts

Showing posts with the label Pivot

UWP: Need to reduce the space between Pivot and PivotItem Header. Is there a way out?

Image
Real estate control is a common theme especially when it comes to devices such as smartphones with smaller display area. In my previous post , I did not take any particular care to adjust the space between Pivot and PivotItem Header. The display appears as shown. PivotSpace_0 I start with a Blank UWP app and add a Pivot Control as described (for example) here . Most of my posts start with a Blank Project. Now the displayed page appears as shown. In order to control the space (reduce it, essentially) you need to add a Page resource, the resource PivotHeaderItemMargin and reference it in your declration for the Pivot Items. Here is the resource I added for the page to control. PivotSpace_1 Now you need to declare the Margin for the two pivot items(on my page) as shown. Using appropriate value for 'Margin', you can control the space. Here are displays for various Margin settings. For the last item in red, a Margin was also added to the Pivot.  ...

Pivot Control in a Universal Windows Project

Image
Pivot control with its tabs helps you in navigating between items which can be content panes. Each item has a header to provide the text for the tab. The Pivot has a title and is the container of PivotItems. The following 3 images show the navigation between three items.     In this app, the Pivot title is: Navigating with Pivot. The first PivotItem header is 'Home', the second PivotItem's header reads 'English' and the third PivotItem's header is 'Spanish'. I have some text in English in the PivotItem with header 'English' and similarly a translation of the English text to Spanish in the PivotItem for Spanish. You can go from one page to the other easily. The images are from a deployment to a Lumia 950 phone. Home is the first PivotItem in the app:  Now navigated to English Now navigated to the 'Spanish' Now the code is very simple and uses only XAML statements Here is the MainPage.xaml: Note: Although th...