本篇博客主要介紹一個控件庫,HslControls.dll 的界面,這個控件庫支持winform,winform的參考另外一篇文章:http://www.javashuo.com/article/p-mjxsjqwi-db.htmlhtml
此處的控件是在手機中運行的,是基於C#的平臺的 android
源代碼地址:https://github.com/dathlin/HslControlsDemogit
的,具體的教程地址以下:https://docs.microsoft.com/zh-cn/xamarin/android/indexgithub
新建一個項目,而後在nuget安裝控件app
Install-Package HslControls
而後在佈局控件裏輸入下面的信息便可佈局
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:showIn="@layout/app_bar_main"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="這是安卓版的HslControls的Demo項目,詳細請打開菜單" /> <HslControls.HslBottle android:layout_marginTop="20px" android:layout_marginLeft="20px" android:layout_width="100px" android:layout_height="400px" /> <HslControls.HslBottle android:layout_marginTop="20px" android:layout_marginLeft="200px" android:layout_width="100px" android:layout_height="400px" app:value="80" /> <HslControls.HslPumpOne android:layout_width="400px" android:layout_marginLeft="500px" android:layout_marginTop="50px" app:export="5" android:layout_height="400px" /> <HslControls.HslPumpOne android:layout_width="100px" android:layout_marginLeft="900px" android:layout_marginTop="50px" android:layout_height="100px" android:id="@+id/hslPumpOne2" /> <HslControls.HslArrow android:layout_marginTop="520px" android:layout_marginLeft="20px" android:layout_width="300px" android:layout_height="90px" /> <HslControls.HslArrow android:layout_marginTop="600px" android:layout_marginLeft="20px" android:layout_width="90px" app:arrowDirection="Down" app:arrowBackColor="@android:color/holo_red_light" android:layout_height="300px" /> <HslControls.HslFactory android:layout_marginTop="1100px" android:layout_width="500px" android:layout_height="300px" /> </RelativeLayout>
界面以下:spa
其餘的控件都是相似的,如下展現一些經常使用的控件信息code