I am starting development of mobile application in xamarin
using Xamarin Studio
. I have created a sample xamarin.forms
project. The project has 3 packages. Sample
, Sample.droid
and Sample.iOS
. Sample.Droid has layout folder and Sample.iOS has storyboards. The package named Sample
does not have UI related files Do I need to develop UI in both the packages separately? If yes, what about the logic/code? Please provide a link which explains me this properly. Thanks in advance.
Asked
Active
Viewed 556 times
0

focus
- 25
- 1
- 9
-
The whole point of using Xamarin Forms is to create cross platform UI. The Xamarin site has extensive documentation and samples. https://developer.xamarin.com/guides/xamarin-forms/ – Jason Dec 27 '16 at 02:58
-
@Jason Yes I understand that, but my question, why are UI layouts provided in different packages for android and iOS, can I discard that? If yes where should I write my UI and code? – focus Dec 27 '16 at 03:14
-
I believe by default the splash page for each platform is performed by a layout/storyboard. In Forms the main app UI is generally located in the shared project. The default Forms template should create some boilerplate UI for you. – Jason Dec 27 '16 at 03:19
-
@Jason Thanks you for your answer. I will have a look, I did not find any UI in shared project. That is the main reason I am confused. Thank you for your help. – focus Dec 27 '16 at 04:21
-
There should be an App.cs (or App.xaml.cs) file in the shared project (may also be named "ProjectName" instead of "App") that will have the bootstrap UI for the Forms project. – Jason Dec 27 '16 at 04:29
-
@Jason Ok Will check. thanks – focus Dec 27 '16 at 05:02
-
1Possible duplicate of [When to use Xamarin.Forms vs Xamarin Native?](http://stackoverflow.com/questions/32204807/when-to-use-xamarin-forms-vs-xamarin-native) – Demitrian Dec 27 '16 at 08:34
1 Answers
1
No.Never.No Need to Create UI separately for different platform .if you will do then there is no meaning of xamarin.
Xamarin.forms is used for creating cross platform mobile application.where you can create common code for UI as well as back end logic in shared project and that will be runnable for all platform like IOS,Android,UWP.Thats the the main concept of xamarin.forms.
and of course if you want some UI changes according to platform like.you want some different UI for button in Ios and android then you can use customrenderer for that That will provide differnt look for differnt plateform runtime.
Here https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/ you can study in detail about custom renderer.

Neelam Prajapati
- 3,764
- 3
- 28
- 62