安卓Super_EditText第三方插件简单使用

第一步,在build.gradle(app)中添加
implementation 'com.carson_ho:Super_EditText:1.0.0'
如果AS的版本不是3.0以上的话按下面的方式添加
compile 'com.carson_ho:Super_EditText:1.0.0'


使用的话直接在布局文件中使用即可

    <scut.carson_ho.diy_view.SuperEditText
        android:id="@+id/ed_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="15dp"
        android:inputType="number"
        android:paddingLeft="5dp"
        android:layout_marginRight="15dp"
        android:hint="请输入账号:"/>

下面具体说一下各个属性的内容以及使用方式

<scut.carson_ho.diy_view.SuperEditText
     * android:layout_width="200dp"
     * android:layout_height="wrap_content"
     * // 设置左侧图标
     * app:ic_left_click="@drawable/ic_left_click"
     * app:ic_left_unclick="@drawable/ic_left_unclick"
     * app:left_x="0"
     * app:left_y="0"
     * app:left_width="60"
     * app:left_height="60"
     * <p>
     * // 设置删除图标
     * app:ic_delete="@drawable/delete"
     * app:delete_x="0"
     * app:delete_y="0"
     * app:delete_width="80"
     * app:delete_height="80"
     * <p>
     * // 设置分割线
     * app:lineColor_click="@color/colorfocus"
     * app:lineColor_unclick="@color/colorDeafult"
     * app:linePosition="1"
     * <p>
     * // 设置光标
     * app:cursor="@drawable/cursortest"
     * <p>
     * />
     * <p>
其他的和EditText的使用方式一样,嗯,就这样,哪里写的不对请大家给我留言。

猜你喜欢

转载自blog.csdn.net/haojiagou/article/details/80519232
今日推荐