Xamarin Interview Questions and Answers
Question - 71 : - What is is the difference between ListView & TableView?
Answer - 71 : -
The ListView and TableView controls are so similar, you can think of them as a single control. The major difference between the two is the manner in which they lay out their items, and it’s easy to change the layout so each control emulates the other.
The ListView control displays its data stacked vertically, much like a standard listbox. Use this control to display an ordered list of data, especially long lists that require scrolling like a list of email messages, a list of contacts, or search results.
The TableView control displays its data stacked horizontally in rows (although you can alter this behavior and have it displayed in columns first, as well). You use this control when you need more space for rich visualization of each item to be displayed.
One of the big differences is ListView provides you a ItemsSource and a Itemtemplate and TableView does not. So items must be added as children manually.
Question - 72 : - What is the difference between Modal pages and Modeless pages?
Answer - 72 : -
Modal Page: We’ll use modal pages when your application needs some information from the user and you don’t want the user to return to the previous page until that information is provided. Below C# code is used to navigate to specific page name is DetailPage.
async void ModelPageNavigation ()
{
await Navigation.PushModalAsync (new DetailPage ()); //Navigate to Details Page
}
Modeless Page: The difference between modal and modeless pages mostly involves the user interface that the operating system provides Back button on the page to return back to the previous page.
async void ModelessPageNavigation ()
{
await Navigation.PushAsync (new DetailPage ()); //Navigate to Details Page, will create Back button navigation page
}
Question - 73 : - What is the other name of Xamarin 2.0?
Answer - 73 : -
Xamarin 2.0 wat the second release of Xamarin which released in February 2013 and is also known
Question - 74 : - What is the basic architecture of Xamarin.Forms project?
Answer - 74 : -
Xamarin.Forms can consists of four (this varies based on requirements) projects under one solution.
- .NET Standard, PCL or Shared Project
- iOS Project
- Android Project
- UWP Project
Question - 75 : - What are the different kinds of Pages in Xamarin.Forms?
Answer - 75 : -
Fortunately Xamarin.Forms support multiple page representations, And every representation is having its own purpose like below:
- ContentPage – A Page that displays a single View, often a container such as a StackLayout or a ScrollView.
- MasterDetailPage – A Page that manages two panes of information.
- NavigationPage – A Page that manages the navigation and user-experience of a stack of other pages.
- TabbedPage – A Page that allows navigation between children pages, using tabs.
- TemplatedPage – A Page that displays full-screen content with a control template, and the base class for ContentPage.
- CarouselPage – A Page allowing swipe gestures between subpages, like a gallery.
Question - 76 : - Name 5 Apps That Were Designed With Xamarin For Ios?
Answer - 76 : -
- Apocalypse Archer: Zombie Invasion
- Stone Skimmer – The skimming action game
- QuickPlan – Project Plan HD
- KorfballScout
- Newspager.
Question - 77 : - What are uses of DataPages in Xamarin.Forms?
Answer - 77 : -
Data pages allow developers to quickly and easily consume a supported data source and render it using built-in UI scaffolding that can be customized with themes.
Question - 78 : - What are different type of Data Binding modes in Xamarin?
Answer - 78 : -
Data binding connects two objects, called the source and the target. So the relationship between target and source is defined by members of the BindingMode enumeration and there is four kinds of binding modes are available in Xamarin.Forms.
- Default (Optional & not considered)
- OneWay — changes in the source affect the target (normal).
- OneWayToSource — changes in the target affect the source.
- TwoWay — changes in the source and target affect each other.
Question - 79 : - How many ways can we share the code?
Answer - 79 : -
There are three ways we can share code:
Shared Project: Here, if required, we write platform specific code using #if compiler directives.
Portable Class Libraries: Here, we create a PCL targeting the platforms we wish to support and then we use Interfaces & Dependency Services to use platform specific functionality. .NET Standard Libraries: It works similar to the PCL and requires Interfaces to work with platform specific functionality.
Question - 80 : - What are Triggers? How many types of Triggers are available?
Answer - 80 : -
Triggers allow us to declare actions in XAML which changes the appearance of the control when specific condition is met for specific control property or specific event is raised.
We can add triggers to the control-level, page-level or application-level in the resource dictionary. There are four types of Triggers.
Property Trigger: executed when a property on a control is set to a particular value
- Data Trigger: It is similar to the property trigger but it leverages the use of data binding
- Event Trigger: occurs when some specified event is raised on the control
- Multi Trigger: allows multiple trigger conditions to be set before an action occurs