Create Embedded ListView Using Visual Studio 2017 Xamarin - xaml

I already create a TabbedPage with 5 Tabs. The 5th Tab is called "More". In this tab, I want to create a embed listview like the image below.
May I know how can do it?

It looks like a TableView in Xamarin.Form.
TableView can be created as below.
<TableView Intent="Settings">
<TableRoot>
<TableSection Title="Ring">
<SwitchCell Text="New Voice Mail" />
<SwitchCell Text="New Mail" On="true" />
</TableSection>
</TableRoot>
</TableView>
The full example can be found here
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/tableview

Related

NavigationView icons + text in compact mode

I'm trying to accomplish something similar to the image below where in compact mode you have the icon and the text displayed under it.
I'm not that familiar with modifying the underlying template for the NavigationView to make this work. Can you give me an advice on how to do this?
The code for the NavigationView is pretty much the default one:
<winui:NavigationView
x:Name="navigationView"
Background="{ThemeResource SystemControlBackgroundAltHighBrush}"
IsBackButtonVisible="Collapsed"
IsBackEnabled="False"
IsPaneToggleButtonVisible="False"
IsSettingsVisible="False"
PaneDisplayMode="LeftCompact"
SelectedItem="{x:Bind ViewModel.Selected, Mode=OneWay}">
<winui:NavigationView.MenuItems>
<winui:NavigationViewItem x:Uid="Shell_Main" helpers:NavHelper.NavigateTo="views:MainPage">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="" />
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<winui:NavigationViewItem x:Uid="Shell_WorkOrders" helpers:NavHelper.NavigateTo="views:WorkOrdersPage">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="" />
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<winui:NavigationViewItem x:Uid="Shell_Materials" helpers:NavHelper.NavigateTo="views:MaterialsPage">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="" />
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
<winui:NavigationViewItem x:Uid="Shell_Documentation" helpers:NavHelper.NavigateTo="views:DocumentationPage">
<winui:NavigationViewItem.Icon>
<FontIcon Glyph="" />
</winui:NavigationViewItem.Icon>
</winui:NavigationViewItem>
</winui:NavigationView.MenuItems>
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="ItemInvoked">
<ic:InvokeCommandAction Command="{x:Bind ViewModel.ItemInvokedCommand}" />
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>
<Grid>
<Frame x:Name="shellFrame" />
</Grid>
</winui:NavigationView>
NavigationView icons + text in compact mode
it's hard to make interface like the screenshot that you mentioned above, you need to edit the default NavigationViewItemPresenter style, and set icon above and content bottom.
For making navigation like above, we suggest you custom side navigation with SplitView to replace default NavigationView. and set ListView as pane content. Then you could design the nav item flexibly by customizing ItemTemplate .
For more detail please refer to Xaml-Controls-Gallery here.

Line break after back button - Xamarin Forms

I am new to Xamarin forms and have directed to a navigation page from my main page, I'd like the title to appear on the same line as the back button but it's currently appearing on the line below, like this -
https://i.imgur.com/lpsJjle.png
I am using the following code to display the title -
<NavigationPage.TitleView>
<StackLayout>
<Label
Text="About" TextColor="{StaticResource lightGreen}">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String"
Android="GothamRoundedMedium.ttf#GothamRoundedMedium"
iOS="GothamRoundedMedium">
</OnPlatform>
</Label.FontFamily>
</Label>
</StackLayout>
</NavigationPage.TitleView>
and this code to navigate to the about page -
Navigation.PushAsync(new NavigationPage(new Survey2()));
Any help would be much appreciated!
With new NavigationPage you are again creating a new NavigationPage.
So,just use:
Navigation.PushAsync(new Survey2());
If you need to use Modal,use this:
Navigation.PushModalAsync(new NavigationPage(new Survey2()));

Xamarin.Forms Toolbar Item Icon Size

I have a Xamarin.Forms PCL project and I am trying to add a Toolbar to my App as below and my target platform is UWP.
<ContentPage.ToolbarItems>
<ToolbarItem Icon="attach.png" Order="Primary" Priority="1" />
<ToolbarItem Icon="camera.png" Order="Primary" Priority="1" />
<ToolbarItem Text="Item1" Order="Secondary" Priority="1" />
<ToolbarItem Text="Item2" Order="Secondary" Priority="2" />
<ToolbarItem Text="Item3" Order="Secondary" Priority="3" />
<ToolbarItem Text="Item4" Order="Secondary" Priority="4" />
</ContentPage.ToolbarItems>
I have added all icon sources to root folder of UWP project. When i run the app on Windows 10 Desktop, icons appears too small. Orginal size of the image is okay though.
I would be appreciated if someone know how to fix this.
Unfortunately, I can't reproduce your issue in my side. And I have used the same icon in UWP and xamarin.forms to do a comparison. They do not make any difference in size.
The size of ToolbarItem icon is fixed. If you used icon with text description, then the image will look very small, in case of which you can set ToolBarItem Text property. When you click More Button, ToolbarItems will be expanded so that the text can be display well. And you'd better use a image whose active area is big enough.
<ToolbarItem Icon="camera.png" Order="Primary" Priority="1" Text="camera"/>

Search Bar inside ViewCell doesn't allow input from keyboard in Android

I'm using Xamarin.Forms and I wanted to put some controls inside a TableView. One of them is a SearchBar, which is inside a ViewCell.
I tested this one in my Android phone and it doesn't allow me to input from keyboard, I tap on it and it doesn't bring keyboard.
Perhaps is bug or I am using the wrong Cell type for a SearchBar.
<ContentPage.Content>
...
<TableView>
<TableRoot>
<TableSection Title="Cliente">
<ViewCell>
<SearchBar x:Name="txtBusquedaCliente" Placeholder="Seleccione..." />
</ViewCell>
<SwitchCell x:Name="swFormato" Text="Shor Format: " ></SwitchCell>
</TableSection>
...
</TableView>
...
</ContentPage.Content>

Set an image in a button

I'm currently developing a Windows Phone application.
I have a view with a button in which I would like to set an image.
I found a lot of solution through Internet but it still not work.
Actually, it works when I put an URL from the Internet. The image is well displayed on the button but when it's from my resources folder, no image is loaded.
Here is my XAML code to do that :
<Button Grid.Row="1" Command="{Binding ShowSearchFilterCommand}" Height="100" Width="100">
<StackPanel>
<Image Source="resources/SearchFilterIcon.png" />
</StackPanel>
</Button>
I set the build action of my image to "Content". The designer display the image so I don't understand what I did wrong.
You have to set the correct path to your image source as in a way /FolderName/ImageName.png.
If the images are placed inside nested folders set like this
Source="/FirstFolderName/SecondFolderName/.../ImageName.Extnsion"
Try this:
<Button>
<ItemsControl>
<Image Source="/Assets/images/ImageName.png"></Image>
</ItemsControl>
</Button>