This commit is contained in:
David Britch 2020-08-12 12:49:08 +01:00 коммит произвёл GitHub
Родитель beb89b8c73
Коммит 76ea16a7fb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
81 изменённых файлов: 1767 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,20 @@
---
name: Xamarin.Forms - RelativeLayout
description: "This sample demonstrates how to use the Xamarin.Forms RelativeLayout (UI)"
page_type: sample
languages:
- csharp
products:
- xamarin
extensions:
tags:
- ui
urlFragment: userinterface-relativelayoutdemos
---
# RelativeLayout
This sample demonstrates how to use the Xamarin.Forms `RelativeLayout`.
For more information about this sample, see [Xamarin.Forms RelativeLayout](https://docs.microsoft.com/xamarin/xamarin-forms/user-interface/layouts/relativelayout).
![RelativeLayout application screenshot](Screenshots/01All.png "RelativeLayout application screenshot")

Просмотреть файл

@ -0,0 +1,19 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".
These files will be deployed with your package and will be accessible using Android's
AssetManager, like this:
public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
InputStream input = Assets.Open ("my_asset.txt");
}
}
Additionally, some Android functions will automatically load asset files:
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");

Просмотреть файл

@ -0,0 +1,20 @@
using Android.App;
using Android.Content.PM;
using Android.OS;
namespace RelativeLayoutDemos.Droid
{
[Activity(Label = "RelativeLayoutDemos", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
LoadApplication(new App());
}
}
}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.relativelayoutdemos">
<uses-sdk android:minSdkVersion="21" />
<application android:label="RelativeLayoutDemos.Android" android:theme="@style/MainTheme"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

Просмотреть файл

@ -0,0 +1,30 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RelativeLayoutDemos.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RelativeLayoutDemos.Android")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
// Add some common permissions, these can be removed if not needed
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]

Просмотреть файл

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{965F86A1-FC96-46BF-B2BE-3CB937D52F44}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
<OutputType>Library</OutputType>
<RootNamespace>RelativeLayoutDemos.Droid</RootNamespace>
<AssemblyName>RelativeLayoutDemos.Android</AssemblyName>
<Deterministic>True</Deterministic>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\Tabbar.xml" />
<AndroidResource Include="Resources\layout\Toolbar.xml" />
<AndroidResource Include="Resources\values\styles.xml" />
<AndroidResource Include="Resources\values\colors.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\drawable\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RelativeLayoutDemos\RelativeLayoutDemos.csproj">
<Project>{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}</Project>
<Name>RelativeLayoutDemos</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,50 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.
For example, a sample Android app that contains a user interface layout (main.xml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable-hdpi/
icon.png
drawable-ldpi/
icon.png
drawable-mdpi/
icon.png
layout/
main.xml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called
"Resource" that contains the tokens for each one of the resources included. For example,
for the above Resources layout, this is what the Resource class would expose:
public class Resource {
public class drawable {
public const int icon = 0x123;
}
public class layout {
public const int main = 0x456;
}
public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
string in the dictionary file values/strings.xml.

Просмотреть файл

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_tabs" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:tabIndicatorColor="@android:color/white" app:tabGravity="fill" app:tabMode="fixed" />

Просмотреть файл

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

Просмотреть файл

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/launcher_background" />
<foreground android:drawable="@mipmap/launcher_foreground" />
</adaptive-icon>

Просмотреть файл

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/launcher_background" />
<foreground android:drawable="@mipmap/launcher_foreground" />
</adaptive-icon>

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.6 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 11 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.9 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 18 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 12 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 33 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 19 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 51 KiB

Просмотреть файл

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="launcher_background">#FFFFFF</color>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>

Просмотреть файл

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
<!-- As of Xamarin.Forms 4.6 the theme has moved into the Forms binary -->
<!-- If you want to override anything you can do that here. -->
<!-- Underneath are a couple of entries to get you started. -->
<!-- Set theme colors from https://aka.ms/material-colors -->
<!-- colorPrimary is used for the default action bar background -->
<!--<item name="colorPrimary">#2196F3</item>-->
<!-- colorPrimaryDark is used for the status bar -->
<!--<item name="colorPrimaryDark">#1976D2</item>-->
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<!--<item name="colorAccent">#FF4081</item>-->
</style>
</resources>

Просмотреть файл

@ -0,0 +1,7 @@
<Application
x:Class="RelativeLayoutDemos.UWP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:RelativeLayoutDemos.UWP">
</Application>

Просмотреть файл

@ -0,0 +1,92 @@
using System;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace RelativeLayoutDemos.UWP
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
Xamarin.Forms.Forms.Init(e);
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (e.PrelaunchActivated == false)
{
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
}
}
/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
}
}

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.5 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.9 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.6 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.2 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.1 KiB

Просмотреть файл

@ -0,0 +1,14 @@
<forms:WindowsPage
x:Class="RelativeLayoutDemos.UWP.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:forms="using:Xamarin.Forms.Platform.UWP"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
</Grid>
</forms:WindowsPage>

Просмотреть файл

@ -0,0 +1,11 @@
namespace RelativeLayoutDemos.UWP
{
public sealed partial class MainPage
{
public MainPage()
{
this.InitializeComponent();
this.LoadApplication(new RelativeLayoutDemos.App());
}
}
}

Просмотреть файл

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">
<Identity
Name="0db7d993-98de-4a58-bc4d-a5a8c4d9654c"
Publisher="CN=Dave"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="0db7d993-98de-4a58-bc4d-a5a8c4d9654c" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>RelativeLayoutDemos.UWP</DisplayName>
<PublisherDisplayName>Dave</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="RelativeLayoutDemos.UWP.App">
<uap:VisualElements
DisplayName="RelativeLayoutDemos.UWP"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="RelativeLayoutDemos.UWP"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

Просмотреть файл

@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RelativeLayoutDemos.UWP")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RelativeLayoutDemos.UWP")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]

Просмотреть файл

@ -0,0 +1,31 @@
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Serialize="All" />
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>

Просмотреть файл

@ -0,0 +1,177 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RelativeLayoutDemos.UWP</RootNamespace>
<AssemblyName>RelativeLayoutDemos.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
<OutputPath>bin\ARM64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.10</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms">
<Version>4.8.0.1269</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RelativeLayoutDemos\RelativeLayoutDemos.csproj">
<Project>{10f682d3-b4b9-475b-9cef-b3a290d7a98e}</Project>
<Name>RelativeLayoutDemos</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace RelativeLayoutDemos.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
}
}

Просмотреть файл

@ -0,0 +1,117 @@
{
"images": [
{
"scale": "2x",
"size": "20x20",
"idiom": "iphone",
"filename": "Icon40.png"
},
{
"scale": "3x",
"size": "20x20",
"idiom": "iphone",
"filename": "Icon60.png"
},
{
"scale": "2x",
"size": "29x29",
"idiom": "iphone",
"filename": "Icon58.png"
},
{
"scale": "3x",
"size": "29x29",
"idiom": "iphone",
"filename": "Icon87.png"
},
{
"scale": "2x",
"size": "40x40",
"idiom": "iphone",
"filename": "Icon80.png"
},
{
"scale": "3x",
"size": "40x40",
"idiom": "iphone",
"filename": "Icon120.png"
},
{
"scale": "2x",
"size": "60x60",
"idiom": "iphone",
"filename": "Icon120.png"
},
{
"scale": "3x",
"size": "60x60",
"idiom": "iphone",
"filename": "Icon180.png"
},
{
"scale": "1x",
"size": "20x20",
"idiom": "ipad",
"filename": "Icon20.png"
},
{
"scale": "2x",
"size": "20x20",
"idiom": "ipad",
"filename": "Icon40.png"
},
{
"scale": "1x",
"size": "29x29",
"idiom": "ipad",
"filename": "Icon29.png"
},
{
"scale": "2x",
"size": "29x29",
"idiom": "ipad",
"filename": "Icon58.png"
},
{
"scale": "1x",
"size": "40x40",
"idiom": "ipad",
"filename": "Icon40.png"
},
{
"scale": "2x",
"size": "40x40",
"idiom": "ipad",
"filename": "Icon80.png"
},
{
"scale": "1x",
"size": "76x76",
"idiom": "ipad",
"filename": "Icon76.png"
},
{
"scale": "2x",
"size": "76x76",
"idiom": "ipad",
"filename": "Icon152.png"
},
{
"scale": "2x",
"size": "83.5x83.5",
"idiom": "ipad",
"filename": "Icon167.png"
},
{
"scale": "1x",
"size": "1024x1024",
"idiom": "ios-marketing",
"filename": "Icon1024.png"
}
],
"properties": {},
"info": {
"version": 1,
"author": "xcode"
}
}

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 69 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.6 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.6 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.1 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 845 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.5 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.4 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.7 KiB

Просмотреть файл

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>CFBundleDisplayName</key>
<string>RelativeLayoutDemos</string>
<key>CFBundleIdentifier</key>
<string>com.companyname.RelativeLayoutDemos</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>CFBundleName</key>
<string>RelativeLayoutDemos</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace RelativeLayoutDemos.iOS
{
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RelativeLayoutDemos.iOS")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RelativeLayoutDemos.iOS")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Просмотреть файл

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}</ProjectGuid>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{6143fdea-f3c2-4a09-aafa-6e230626515e}</TemplateGuid>
<OutputType>Exe</OutputType>
<RootNamespace>RelativeLayoutDemos.iOS</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>RelativeLayoutDemos.iOS</AssemblyName>
<MtouchEnableSGenConc>true</MtouchEnableSGenConc>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<ProvisioningType>automatic</ProvisioningType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchArch>x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
<MtouchDebug>true</MtouchDebug>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchLink>None</MtouchLink>
<MtouchArch>x86_64</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchArch>ARM64</MtouchArch>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>None</MtouchLink>
<MtouchInterpreter>-all</MtouchInterpreter>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchArch>ARM64</MtouchArch>
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<None Include="Entitlements.plist" />
<None Include="Info.plist" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon1024.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon180.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon167.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon152.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon120.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon87.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon80.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon76.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon60.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon58.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon40.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon29.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon20.png">
<Visible>false</Visible>
</ImageAsset>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\RelativeLayoutDemos\RelativeLayoutDemos.csproj">
<Project>{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}</Project>
<Name>RelativeLayoutDemos</Name>
</ProjectReference>
</ItemGroup>
</Project>

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 8.7 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 10 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 34 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.1 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 8.2 KiB

Просмотреть файл

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="X5k-f2-b5h">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238" />
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="gAE-YM-kbH">
<objects>
<viewController id="X5k-f2-b5h" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Y8P-hJ-Z43" />
<viewControllerLayoutGuide type="bottom" id="9ZL-r4-8FZ" />
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="yd7-JS-zBw">
<rect key="frame" x="0.0" y="0.0" width="600" height="600" />
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" />
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" image="Icon-60.png" translatesAutoresizingMaskIntoConstraints="NO" id="23">
<rect key="frame" x="270" y="270" width="60" height="60" />
<rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0" />
</imageView>
</subviews>
<color key="backgroundColor" red="0.20392156862745098" green="0.59607843137254901" blue="0.85882352941176465" alpha="1" colorSpace="calibratedRGB" />
<constraints>
<constraint firstItem="23" firstAttribute="centerY" secondItem="yd7-JS-zBw" secondAttribute="centerY" priority="1" id="39" />
<constraint firstItem="23" firstAttribute="centerX" secondItem="yd7-JS-zBw" secondAttribute="centerX" priority="1" id="41" />
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="XAI-xm-WK6" userLabel="First Responder" sceneMemberID="firstResponder" />
</objects>
<point key="canvasLocation" x="349" y="339" />
</scene>
</scenes>
<resources>
<image name="Icon-60.png" width="180" height="180" />
</resources>
</document>

Просмотреть файл

@ -0,0 +1,152 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30320.27
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RelativeLayoutDemos.Android", "RelativeLayoutDemos.Android\RelativeLayoutDemos.Android.csproj", "{965F86A1-FC96-46BF-B2BE-3CB937D52F44}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RelativeLayoutDemos.iOS", "RelativeLayoutDemos.iOS\RelativeLayoutDemos.iOS.csproj", "{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RelativeLayoutDemos", "RelativeLayoutDemos\RelativeLayoutDemos.csproj", "{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RelativeLayoutDemos.UWP", "RelativeLayoutDemos.UWP\RelativeLayoutDemos.UWP.csproj", "{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|iPhone = Debug|iPhone
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|iPhone = Release|iPhone
Release|iPhoneSimulator = Release|iPhoneSimulator
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|ARM.ActiveCfg = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|ARM.Build.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|ARM.Deploy.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|ARM64.Build.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|ARM64.Deploy.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|iPhone.Build.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|x64.ActiveCfg = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|x64.Build.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|x64.Deploy.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|x86.ActiveCfg = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|x86.Build.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Debug|x86.Deploy.0 = Debug|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|Any CPU.Build.0 = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|ARM.ActiveCfg = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|ARM.Build.0 = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|ARM.Deploy.0 = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|ARM64.ActiveCfg = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|ARM64.Build.0 = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|ARM64.Deploy.0 = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|iPhone.ActiveCfg = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|iPhone.Build.0 = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|x64.ActiveCfg = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|x64.Build.0 = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|x64.Deploy.0 = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|x86.ActiveCfg = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|x86.Build.0 = Release|Any CPU
{965F86A1-FC96-46BF-B2BE-3CB937D52F44}.Release|x86.Deploy.0 = Release|Any CPU
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Debug|ARM.ActiveCfg = Debug|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Debug|ARM64.ActiveCfg = Debug|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Debug|iPhone.ActiveCfg = Debug|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Debug|iPhone.Build.0 = Debug|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Debug|x64.ActiveCfg = Debug|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Debug|x86.ActiveCfg = Debug|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Release|ARM.ActiveCfg = Release|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Release|ARM64.ActiveCfg = Release|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Release|iPhone.ActiveCfg = Release|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Release|iPhone.Build.0 = Release|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Release|x64.ActiveCfg = Release|iPhone
{FCBDFEC6-04C2-4CAE-980F-ECB0AC7267EC}.Release|x86.ActiveCfg = Release|iPhone
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|ARM.ActiveCfg = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|ARM.Build.0 = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|ARM64.Build.0 = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|iPhone.Build.0 = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|x64.ActiveCfg = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|x64.Build.0 = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|x86.ActiveCfg = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Debug|x86.Build.0 = Debug|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|Any CPU.Build.0 = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|ARM.ActiveCfg = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|ARM.Build.0 = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|ARM64.ActiveCfg = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|ARM64.Build.0 = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|iPhone.ActiveCfg = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|iPhone.Build.0 = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|x64.ActiveCfg = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|x64.Build.0 = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|x86.ActiveCfg = Release|Any CPU
{10F682D3-B4B9-475B-9CEF-B3A290D7A98E}.Release|x86.Build.0 = Release|Any CPU
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|Any CPU.ActiveCfg = Debug|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|ARM.ActiveCfg = Debug|ARM
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|ARM.Build.0 = Debug|ARM
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|ARM.Deploy.0 = Debug|ARM
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|ARM64.ActiveCfg = Debug|ARM64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|ARM64.Build.0 = Debug|ARM64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|ARM64.Deploy.0 = Debug|ARM64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|iPhone.ActiveCfg = Debug|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|x64.ActiveCfg = Debug|x64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|x64.Build.0 = Debug|x64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|x64.Deploy.0 = Debug|x64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|x86.ActiveCfg = Debug|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|x86.Build.0 = Debug|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Debug|x86.Deploy.0 = Debug|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|Any CPU.ActiveCfg = Release|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|ARM.ActiveCfg = Release|ARM
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|ARM.Build.0 = Release|ARM
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|ARM.Deploy.0 = Release|ARM
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|ARM64.ActiveCfg = Release|ARM64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|ARM64.Build.0 = Release|ARM64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|ARM64.Deploy.0 = Release|ARM64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|iPhone.ActiveCfg = Release|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|iPhoneSimulator.ActiveCfg = Release|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|x64.ActiveCfg = Release|x64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|x64.Build.0 = Release|x64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|x64.Deploy.0 = Release|x64
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|x86.ActiveCfg = Release|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|x86.Build.0 = Release|x86
{508F7E4F-F57E-4AE7-BCD8-58D810ABDF2A}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1AEBBA99-1DF5-4B7E-8E90-FC12C5480498}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="RelativeLayoutDemos.App">
<Application.Resources>
</Application.Resources>
</Application>

Просмотреть файл

@ -0,0 +1,26 @@
using Xamarin.Forms;
namespace RelativeLayoutDemos
{
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new NavigationPage(new MainPage());
}
protected override void OnStart()
{
}
protected override void OnSleep()
{
}
protected override void OnResume()
{
}
}
}

Просмотреть файл

@ -0,0 +1,3 @@
using Xamarin.Forms.Xaml;
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]

Просмотреть файл

@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
</ItemGroup>
<ItemGroup>
<Folder Include="Views\" />
<Folder Include="Views\XAML\" />
<Folder Include="Views\Code\" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,88 @@
using Xamarin.Forms;
namespace RelativeLayoutDemos.Views
{
public class RelativePositioningAndSizingDemoPageCS : ContentPage
{
public RelativePositioningAndSizingDemoPageCS()
{
RelativeLayout relativeLayout = new RelativeLayout();
// Four BoxView's
relativeLayout.Children.Add(
new BoxView { Color = Color.Red },
Constraint.Constant(0),
Constraint.Constant(0));
relativeLayout.Children.Add(
new BoxView { Color = Color.Green },
Constraint.RelativeToParent((parent) =>
{
return parent.Width - 40;
}), Constraint.Constant(0));
relativeLayout.Children.Add(
new BoxView { Color = Color.Blue },
Constraint.Constant(0),
Constraint.RelativeToParent((parent) =>
{
return parent.Height - 40;
}));
relativeLayout.Children.Add(
new BoxView { Color = Color.Yellow },
Constraint.RelativeToParent((parent) =>
{
return parent.Width - 40;
}),
Constraint.RelativeToParent((parent) =>
{
return parent.Height - 40;
}));
// Centered and 1/3 width and height of parent
BoxView silverBoxView = new BoxView { Color = Color.Silver };
relativeLayout.Children.Add(
silverBoxView,
Constraint.RelativeToParent((parent) =>
{
return parent.Width * 0.33;
}),
Constraint.RelativeToParent((parent) =>
{
return parent.Height * 0.33;
}),
Constraint.RelativeToParent((parent) =>
{
return parent.Width * 0.33;
}),
Constraint.RelativeToParent((parent) =>
{
return parent.Height * 0.33;
}));
// 1/3 width and height of previous
relativeLayout.Children.Add(
new BoxView { Color = Color.Black },
Constraint.RelativeToView(silverBoxView, (parent, sibling) =>
{
return sibling.X;
}),
Constraint.RelativeToView(silverBoxView, (parent, sibling) =>
{
return sibling.Y;
}),
Constraint.RelativeToView(silverBoxView, (parent, sibling) =>
{
return sibling.Width * 0.33;
}),
Constraint.RelativeToView(silverBoxView, (parent, sibling) =>
{
return sibling.Height * 0.33;
}));
Title = "RelativeLayout demo";
Content = relativeLayout;
}
}
}

Просмотреть файл

@ -0,0 +1,69 @@
using System;
using Xamarin.Forms;
namespace RelativeLayoutDemos.Views
{
public class SimpleOverlayDemoPageCS : ContentPage
{
ContentView overlay;
ProgressBar progressBar;
public SimpleOverlayDemoPageCS()
{
Button button = new Button { Text = "Simulate 5-second work item" };
button.Clicked += OnButtonClicked;
StackLayout stackLayout = new StackLayout
{
Margin = new Thickness(20),
Children =
{
new Label { Text = "This might be a page of UI objects except that the only functional UI object on the page is a Button." },
button
}
};
progressBar = new ProgressBar
{
Margin = new Thickness(20),
VerticalOptions = LayoutOptions.Center
};
overlay = new ContentView
{
BackgroundColor = Color.FromHex("#C0808080"),
IsVisible = false,
Content = progressBar
};
RelativeLayout relativeLayout = new RelativeLayout();
relativeLayout.Children.Add(stackLayout, () => 0, () => 0);
relativeLayout.Children.Add(overlay, () => new Rectangle(0, 0, relativeLayout.Width, relativeLayout.Height));
Title = "Simple overlay demo";
Content = relativeLayout;
}
void OnButtonClicked(object sender, EventArgs e)
{
// Show overlay with ProgressBar
overlay.IsVisible = true;
TimeSpan duration = TimeSpan.FromSeconds(5);
DateTime now = DateTime.Now;
Device.StartTimer(TimeSpan.FromSeconds(0.1), () =>
{
double progress = (DateTime.Now - now).TotalMilliseconds / duration.TotalMilliseconds;
progressBar.Progress = progress;
bool continueTimer = progress < 1;
if (!continueTimer)
{
overlay.IsVisible = false;
}
return continueTimer;
});
}
}
}

Просмотреть файл

@ -0,0 +1,60 @@
using Xamarin.Forms;
namespace RelativeLayoutDemos.Views
{
public class StylishHeaderDemoPageCS : ContentPage
{
public StylishHeaderDemoPageCS()
{
RelativeLayout relativeLayout = new RelativeLayout
{
Margin = new Thickness(20)
};
relativeLayout.Children.Add(new BoxView
{
Color = Color.Silver
}, () => new Rectangle(0, 10, 200, 5));
relativeLayout.Children.Add(new BoxView
{
Color = Color.Silver
}, () => new Rectangle(0, 20, 200, 5));
relativeLayout.Children.Add(new BoxView
{
Color = Color.Silver
}, () => new Rectangle(10, 0, 5, 65));
relativeLayout.Children.Add(new BoxView
{
Color = Color.Silver
}, () => new Rectangle(20, 0, 5, 65));
relativeLayout.Children.Add(new Label
{
Text = "Stylish Header",
FontSize = 24
}, Constraint.Constant(30), Constraint.Constant(25));
relativeLayout.Children.Add(new Label
{
FormattedText = new FormattedString
{
Spans =
{
new Span { Text = "Although "},
new Span { Text = "RelativeLayout", FontAttributes = FontAttributes.Italic },
new Span { Text = " is usually employed for purposes other than the display of text using a " },
new Span { Text = "Label", FontAttributes = FontAttributes.Italic },
new Span { Text = ", obviously it can be used in that way. The text continues to wrap nicely within the bounds of the container and any margin that might be applied." }
}
}
}, Constraint.Constant(0), Constraint.Constant(80));
Title = "Stylish header demo";
Content = relativeLayout;
}
}
}

Просмотреть файл

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:RelativeLayoutDemos.Views"
x:Class="RelativeLayoutDemos.MainPage"
Title="RelativeLayout demos">
<TableView Intent="Menu">
<TableRoot>
<TableSection Title="XAML">
<TextCell Text="Stylish header demo"
Detail="Constraint based positioning and sizing"
Command="{Binding NavigateCommand}"
CommandParameter="{x:Type views:StylishHeaderDemoPage}" />
<TextCell Text="Relative positioning and sizing"
Detail="Constraint markup expression"
Command="{Binding NavigateCommand}"
CommandParameter="{x:Type views:RelativePositioningAndSizingDemoPage}" />
<TextCell Text="Simple overlay demo"
Detail="Overlap child views"
Command="{Binding NavigateCommand}"
CommandParameter="{x:Type views:SimpleOverlayDemoPage}" />
</TableSection>
<TableSection Title="C#">
<TextCell Text="Stylish header demo"
Detail="Constraint based positioning and sizing"
Command="{Binding NavigateCommand}"
CommandParameter="{x:Type views:StylishHeaderDemoPageCS}" />
<TextCell Text="Relative positioning and sizing"
Detail="Constraint methods"
Command="{Binding NavigateCommand}"
CommandParameter="{x:Type views:RelativePositioningAndSizingDemoPageCS}" />
<TextCell Text="Simple overlay demo"
Detail="Overlap child views"
Command="{Binding NavigateCommand}"
CommandParameter="{x:Type views:SimpleOverlayDemoPageCS}" />
</TableSection>
</TableRoot>
</TableView>
</ContentPage>

Просмотреть файл

@ -0,0 +1,25 @@
using System;
using System.Windows.Input;
using Xamarin.Forms;
namespace RelativeLayoutDemos
{
public partial class MainPage : ContentPage
{
public ICommand NavigateCommand { get; private set; }
public MainPage()
{
InitializeComponent();
NavigateCommand = new Command<Type>(
async (Type pageType) =>
{
Page page = (Page)Activator.CreateInstance(pageType);
await Navigation.PushAsync(page);
});
BindingContext = this;
}
}
}

Просмотреть файл

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="RelativeLayoutDemos.Views.RelativePositioningAndSizingDemoPage"
Title="RelativeLayout demo">
<RelativeLayout>
<!-- Four BoxView's -->
<BoxView Color="Red"
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant, Constant=0}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant, Constant=0}" />
<BoxView Color="Green"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Constant=-40}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant, Constant=0}" />
<BoxView Color="Blue"
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant, Constant=0}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Constant=-40}" />
<BoxView Color="Yellow"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Constant=-40}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Constant=-40}" />
<!-- Centered and 1/3 width and height of parent -->
<BoxView x:Name="oneThird"
Color="Silver"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.33}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.33}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.33}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.33}" />
<!-- 1/3 width and height of previous -->
<BoxView Color="Black"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=oneThird, Property=X}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=oneThird, Property=Y}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=oneThird, Property=Width, Factor=0.33}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=oneThird, Property=Height, Factor=0.33}" />
</RelativeLayout>
</ContentPage>

Просмотреть файл

@ -0,0 +1,12 @@
using Xamarin.Forms;
namespace RelativeLayoutDemos.Views
{
public partial class RelativePositioningAndSizingDemoPage : ContentPage
{
public RelativePositioningAndSizingDemoPage()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="RelativeLayoutDemos.Views.SimpleOverlayDemoPage"
Title="Simple overlay demo">
<RelativeLayout>
<StackLayout Margin="20">
<Label Text="This might be a page of UI objects except that the only functional UI object on the page is a Button." />
<Button Text="Simulate 5-second work item"
Clicked="OnButtonClicked" />
</StackLayout>
<!-- Overlay -->
<ContentView x:Name="overlay"
BackgroundColor="#C0808080"
IsVisible="False"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}">
<ProgressBar x:Name="progressBar"
Margin="20"
VerticalOptions="Center" />
</ContentView>
</RelativeLayout>
</ContentPage>

Просмотреть файл

@ -0,0 +1,35 @@
using System;
using Xamarin.Forms;
namespace RelativeLayoutDemos.Views
{
public partial class SimpleOverlayDemoPage : ContentPage
{
public SimpleOverlayDemoPage()
{
InitializeComponent();
}
void OnButtonClicked(object sender, EventArgs e)
{
// Show overlay with ProgressBar
overlay.IsVisible = true;
TimeSpan duration = TimeSpan.FromSeconds(5);
DateTime now = DateTime.Now;
Device.StartTimer(TimeSpan.FromSeconds(0.1), () =>
{
double progress = (DateTime.Now - now).TotalMilliseconds / duration.TotalMilliseconds;
progressBar.Progress = progress;
bool continueTimer = progress < 1;
if (!continueTimer)
{
overlay.IsVisible = false;
}
return continueTimer;
});
}
}
}

Просмотреть файл

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="RelativeLayoutDemos.Views.StylishHeaderDemoPage"
Title="Stylish header demo">
<RelativeLayout Margin="20">
<BoxView Color="Silver"
RelativeLayout.XConstraint="0"
RelativeLayout.YConstraint="10"
RelativeLayout.WidthConstraint="200"
RelativeLayout.HeightConstraint="5" />
<BoxView Color="Silver"
RelativeLayout.XConstraint="0"
RelativeLayout.YConstraint="20"
RelativeLayout.WidthConstraint="200"
RelativeLayout.HeightConstraint="5" />
<BoxView Color="Silver"
RelativeLayout.XConstraint="10"
RelativeLayout.YConstraint="0"
RelativeLayout.WidthConstraint="5"
RelativeLayout.HeightConstraint="65" />
<BoxView Color="Silver"
RelativeLayout.XConstraint="20"
RelativeLayout.YConstraint="0"
RelativeLayout.WidthConstraint="5"
RelativeLayout.HeightConstraint="65" />
<Label Text="Stylish header"
FontSize="24"
RelativeLayout.XConstraint="30"
RelativeLayout.YConstraint="25" />
<Label RelativeLayout.XConstraint="0"
RelativeLayout.YConstraint="80">
<Label.FormattedText>
<FormattedString>
<Span Text="Although " />
<Span Text="RelativeLayout"
FontAttributes="Italic" />
<Span Text=" is usually employed for purposes other than the display of text using a " />
<Span Text="Label"
FontAttributes="Italic" />
<Span Text=", obviously it can be used in that way. The text continues to wrap nicely within the bounds of the container and any margin that might be applied." />
</FormattedString>
</Label.FormattedText>
</Label>
</RelativeLayout>
</ContentPage>

Просмотреть файл

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace RelativeLayoutDemos.Views
{
public partial class StylishHeaderDemoPage : ContentPage
{
public StylishHeaderDemoPage()
{
InitializeComponent();
}
}
}

Двоичные данные
UserInterface/Layout/RelativeLayoutDemos/Screenshots/01All.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 101 KiB