首页 > 移动平台 > 详细

[Xamarin.Android] 在Xamarin.Android项目中使用Component套件

时间:2014-10-19 18:17:58      阅读:373      评论:0      收藏:0      [点我收藏+]

[Xamarin.Android] 在Xamarin.Android项目中使用Component套件

前言

在Xamarin中,可以将自己开发的项目包装成为Component套件,来提供开发人员使用。本篇介绍如何下载并安装Component套件,让开发人员能够使用Xamarin Component Store中的各种Component套件,为自己留个纪录也希望能帮助到有需要的开发人员。

bubuko.com,布布扣

使用

  1. 在Xamarin.Android项目中的Components文件夹上,点击右键并且选择「Get More Components...」。

    bubuko.com,布布扣

  2. 选择项目使用的Component套件,来开启Component套件的套件说明。

    bubuko.com,布布扣

  3. 点选「Add to App」来将Component套件加入目标项目。

    bubuko.com,布布扣

  4. 在Components文件夹中新安装的Component套件上,点击右键并且选择「Edit Component...」,就可以开启Component套件的套件说明。

    bubuko.com,布布扣

    bubuko.com,布布扣

  5. 接着依照套件说明介绍的使用方法,在Xamarin.Android项目加入对应的程序代码。

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:flatui="http://schemas.android.com/apk/res-auto"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="20dp">
    
      <FlatUI.FlatEditText
          android:id="@+id/edittextFlat2"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          flatui:fieldStyle="box"
          flatui:cornerRadius="3dip"
          android:layout_margin="10dp"
          android:text="Clark"/>
    
      <FlatUI.FlatButton
          android:id="@+id/buttonBlock"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="10dp"
          android:text="Click Me"
          flatui:textAppearance="none" />
    
      <FlatUI.FlatToggleButton
          android:id="@+id/toggleUncheckedEnabled"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="10dp"
          flatui:size="20dip" />
    
    </LinearLayout>
    
  6. 执行Xamarin.Android项目,就可以看到Component套件在项目中运作的结果。

    bubuko.com,布布扣

[Xamarin.Android] 在Xamarin.Android项目中使用Component套件

原文:http://www.cnblogs.com/clark159/p/4035108.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!