XF 彩色矩形块

<?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:App17"
             x:Class="App17.MainPage">

    <BoxView x:Name="myBoxView" WidthRequest="150" HeightRequest="150" HorizontalOptions="Center" VerticalOptions="Center"></BoxView>

</ContentPage>
 

 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace App17
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            myBoxView.Color = Color.FromHex("FF0000");
        }
    }
}
 

posted @ 2018-08-06 21:41  dxm809  阅读(73)  评论(0编辑  收藏  举报