Android 颜色矩阵——ColorMatrix
1.xml文件
通过GridLayout来进行布局,动态的添加EditText
<?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=".ColorMatrix.ColorMatrixActivity"
android:orientation="vertical">
<ImageView
android:id="@+id/imageview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"/>
<GridLayout
android:id="@+id/group"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:columnCount="5"
android:rowCount="4">
</GridLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:onClick="btnChange"
android:layout_weight="1"
android:text="change"
android:textAllCaps="false"
tools:ignore="OnClick" />
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:onClick="btnReset"
android:layout_weight

本文介绍了一个使用Android实现的颜色矩阵编辑器应用。该应用通过GridLayout动态添加EditText来构成颜色矩阵,并允许用户调整图像的颜色效果。文章详细展示了XML布局、动态添加EditText的方法、颜色矩阵的应用及按钮点击事件的处理。
最低0.47元/天 解锁文章
2056

被折叠的 条评论
为什么被折叠?



