zoukankan      html  css  js  c++  java
  • Xamarin XAML语言教程基本视图ContentViewg构架范围框架

    Xamarin XAML语言教程基本视图ContentViewg构架范围框架

    ContentView视图基本上有三个作用,下面依次介绍。

    (1)范围框架:ContentView视图可以构建一个范围框架,用来约束其中的子元素。

    【示例14-1:ContentViewScopeFrame】以下将使用ContentView来构建一个范围框架,以此来约束其子元素。代码如下:

     

    • <?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:local="clr-namespace:ContentViewScopeFrame"
    •              x:Class="ContentViewScopeFrame.MainPage">
    •   <ContentView BackgroundColor="#B3EE3A"
    •                WidthRequest="300"
    •                HeightRequest="300"
    •                HorizontalOptions="Center"
    •                VerticalOptions="Center">
    •     <Label Text="Hello,Xamarin.Forms"
    •            FontAttributes="Bold"
    •            FontSize="18"
    •            HorizontalOptions="End"
    •            VerticalOptions="End"/>
    •   </ContentView>
    • </ContentPage>

    在此代码中,我们将ContentView视图作为了范围框架,Label只可以在此框架中进行布局。此时运行程序,会看到如图14.8~14.9所示的效果。

     

  • 相关阅读:
    设置WebSphere字符集参数
    防SQL注入
    改变radio/checkbox默认样式
    数据完整性约束错误
    Java项目多数据源配置
    No row with the given identifier exists:错误另解
    ICTCLAS20160405分词系统调试过程
    centos7 忘记root密码
    java之Junit
    javaweb之登录
  • 原文地址:https://www.cnblogs.com/daxueba-ITdaren/p/7145388.html
Copyright © 2011-2022 走看看