Xamarin Forms - iOS - change splash screen depending on screen orientation - c#

I have a problem with adjusting splashscreen in Xamarin Forms iOS project.
I'd like to change splashscreen static image depending on screen orientation.
In Android I simply, created drawable-land folder, put there image for landscape orientation and it's working.
In iOS project there is whole designer for purpose of creating launchscreens, but I can't find anything that will do the job. When I adjust image for Iphone, change orientation in designer I can't simply put there different image because it's shared across all screens in designer.
One important remark - I found some sources on how to achive that, but for native XCode designer, I need an answer for Visual Studio or VS for Mac.
Thanks in advance

Here whatever you apply, will be applied to landscape and portrait universally.
You can have different images, one for portrait 'splash_portrait.png' and one for landscape 'splash_landscape.png' in Assets.
You can then choose which image to display for landscape and which for portrait using Edit Traits button on the bottom right corner in your screenshot.
Landscape uses Any or Compact Height size class, so you would be selecting Compact Height checkbox and whichever change you apply, will be applied for this size class (landscape).
Please get more details on this, here & here
Practically, I haven't tried as while giving answer, I am away from computer. But I hope this will help.

https://www.youtube.com/watch?time_continue=1&v=y3lspdPxc6o,
Refer this tutorial video by Kym Phillpotts - Xamarin University Lightning Lecture.
On the widget properties, you have an option for the full-size splash.

Related

When I set the direction of xamarin forms flyout page to RTL, a gap appears between the side menu and the mobile screen, how can I remove it?

enter image description here
I want to remove this gap shown in the image below, I want it as if it was on the left side without a gap.
Updating the Xamarin.Forms nuget to 5.0.0.2515 in both shared and Android projects has resolved the issue.
I too faced the issue when trying to set flyout page flow direction to RTL in Tab, where it worked fine in mobile device.
I guess the issue has been fixed in the Xamarin.Forms - 5.0.0.2515

Ipad resolution for landscape and portrait - Xamarin ios

I am relatively new to Xamarin ios and am creating an application that
will work in both Landscape and Portrait for both iPhone and iPad.
I have been able to implement both Landscape and portrait on iPhone pretty fine by using a rotation callback method that will invoke a different view with the same layout but adjusted dimensions for the landscape version and on the landscape version I have the same to go back to portrait. This works okay but has some lag at times.
I'm not very sure about what is the right way to present two different UIs for different orientations. If anyone has any suggestions please let me know.
Now I have a list that holds values for Height and Width of the current device and I will devise this by the current device density like so:
maindisplayinfo.height / maindisplayinfo.density
and this gives me the current display dimensions I need. I use this to place my objects relative to a screen portion such as:
CGRect(0, Height * 0.30, Image.Bounds.Width, Image.Bounds.Height)
On rotation on Ipad, the display goes funny even though I have set dimensions correctly and my rotation callback triggers the different views. Not sure what is going on here.
But is there a certain way to do this sort of thing with iPad and iPhone?

why i cant move android app buttons in visual studio with mouse ? in android studio its possible

When I want to move my button with mouse I can't in Visual Studio but in Android Studio it is possible.
Can someone help me to move my buttons with mouse in Visual Studio? I'm using relative layout and still the button can't move.
Xamarin does not support rearrange controls from the designer like android studio.
You have to do that from Xaml code. Try to understand how layouts works on android.
This link will be helpful while explains how to design your GUI using layouts Horizontally, vertically and relative layouts.
Using the Android Designer
So mainly, you have to divide your GUI with layouts and arrange the controls inside. Not moving them to a specific location by mouse.
In addition to that, it's a good practice to learn Dealing with sizes which will show how to use Pixels, points, dps, DIPs, and DIUs for better arranging using margin and padding. And weight attribute is really helpful when arranging the controls

Xamarin iOS auto resize view

I'm getting started with Xamarin using Visual Studio 2013 trying to build an iOS app. I have added a launch screen as an XIB file and the default one they give you (as per the tutorials) just has a few labels and when run on the simulator appears fine.
In the designer when I double click on the XIB, the app view to add components to is square, rather than rectangular and vertical as I would expect for an iPhone display. But the default XIB seems to work.
However I have added a UIView and an image to this, told it to fill the width and height, added two labels in the middle and run it. The displayed image is square and goes off the screen of the simulator, as do the labels. It is not automatically resizing to fill the displayed screen as I would hope.
Basically what I want to know is how to start building basic views with resizable components that will work on any device you use. Can anyone please link me to a tutorial for this using Visual Studio Xamarin for iOS as I don't know what to search for.
What it looks like in designer
How it comes out in simulator

Windows 8 App Using Xaml and C# for Different Screen Size and DPI?

Is there any way or general size template created for windows 8 app using xaml so that we can create application of different screen size and DPI. As we are having in Android we put images and screen UI in different folders and application picks it up depending on different screen size and DPI? I am trying to design a general template for this but just asking if MS has already created something like this?
Besides the default templates that come with VS2012 I am not aware of any other templates. Working with the diff. requirements aren't that much of a hassle if you know how to get started. Here is some information that you might have already seen, but I'll add it here for those reading you questions looking for some information :)
There are different recommendations for scaling to screen size and resolution.
In regards to pixel density and images :
Guidelines for scaling to pixel density (Windows Store apps)
Basically you create folders like so:
Option #1 - File naming convention:
...\test.scale-100.jpg
\test.scale-140.jpg
\test.scale-180.jpg
Option #2 - Folder naming convention:
...\scale-100\test.jpg
\scale-140\test.jpg
\scale-180\test.jpg
in XAML
<Image Grid.Row="0" Grid.Column="1" x:Name="testImage" Source="test.jpg" Margin="2,2,2,2"/>
The resource loading is smart and will fetch the right image from the right folder
As for scaling to screens
Guidelines for scaling to screens (Windows Store apps)
You could:
a) Have a fixed layout that scales to fit the screen
Create a Viewbox control and add your controls to it, set the size to the minimum size you want to support.
Don't add appbars or other stuff that is by default adaptive!
Define letterboxing style and color, and don't forget to add different res. images as I showed above.OR use vector graphics or XAML.
b) Adaptive layout ,- check out the default templates that come with VS2012, they use adaptive layout.
c) I'm sure there are other options/variations

Categories