欢迎访问成都祈钰瑶科技有限公司!

全国免费服务热线:

18982081108
✕

成都网站设计公司,成都响应式网站设计,成都移动端网站设计,成都网站UI设计

Android实现画画板案例-创新互联

本文实例为大家分享了Android实现画画板的具体代码,供大家参考,具体内容如下

创新互联是一家专注于做网站、网站设计与策划设计,承德县网站建设哪家好?创新互联做网站,专注于网站建设十年,网设计领域的专业建站公司;建站业务涵盖:承德县等地区。承德县做网站价格咨询:18980820575

① 准备一个布局文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main"
android:layout_width="match_parent" android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="com.example.it.MainActivity">
<LinearLayout
  android:layout_width="match_parent"
  android:layout_height="wrap_content">
  <Button
    android:text="修改颜色"
    android:onClick="color"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
  <Button
    android:text="粗细+1"
    android:onClick="size"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
  <Button
    android:text="保存图片"
    android:onClick="save"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
</LinearLayout>

<ImageView
  android:id="@+id/iv_bg"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content" />
</LinearLayout>