activity_main.xml 添加自己画的view 组件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
tools:context=".MainActivity">

<myapplication21.lum.com.mycanvas.MyView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</LinearLayout>
--------------------- 

猜你喜欢

转载自www.cnblogs.com/ly570/p/11295935.html