android - 如何使用像 Sticker View Corner 这样的 XML 绘制一个带有圆端圆角的矩形
问题描述
如何为像有的矩形边缘创建圆形StickerView
。我不想用StickerView
,因为它不支持EditText
like功能。
我xml
的矩形代码。我想添加带有圆形大圆点的角。
<?xml version="1.0" encoding="utf-8"?>
<!-- res/drawable/rounded_edittext.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp">
<corners
android:bottomRightRadius="15dp"
android:bottomLeftRadius="15dp"
android:topLeftRadius="15dp"
android:topRightRadius="15dp"/>
</shape>
下面是mainactivity.xml
我实现边框的代码 RotatableAutofitEditText
。
<com.agilie.RotatableAutofitEditText xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:autofit="http://schemas.android.com/apk/res-auto"
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="128dp"
android:layout_marginTop="272dp"
android:background="@drawable/borders"
android:gravity="center"
android:hint="@string/hint_add_some_text"
android:text="Type Here"
android:textColor="@android:color/white"
android:textColorHint="@android:color/darker_gray"
autofit:clipBounds="false"
autofit:layout_constraintStart_toStartOf="parent"
autofit:layout_constraintTop_toTopOf="parent"
autofit:maxTextSize="@dimen/autoresize_max_text_size"
autofit:minTextSize="@dimen/autoresize_min_text_size"
autofit:minWidth="@dimen/autoresize_min_width"
autofit:movable="true"
autofit:resizable="true"
autofit:rotatable="true" />
解决方案
Github 链接列表StickerView
- https://github.com/nimengbo/StickerView
- https://github.com/kencheung4/android-StickerView
- https://github.com/uptechteam/MotionViews-Android
- https://github.com/wuapnjie/StickerView
- https://github.com/sangmingming/StickerView
- https://github.com/niravkalola/Android-StickerView
- https://github.com/Kaka252/StickerView
- https://github.com/yovenny/StickerView
https://github.com/lukehutch/android-multitouch-controller 这处理 3 合 1 设施。在 Multi-Touch 上,您可以平移图像、缩放图像,同时还可以旋转图像。您可以根据需要添加贴纸数量。
推荐阅读
- sql-server - Lead/Lag 语法帮助 - 如何对列进行排序?
- vaadin - 活页夹是自动处理 Vaadin 8 布局中所需的数据输入字段的唯一方法吗?
- asp.net-web-api - RestSharp ExecuteAsync UI 不等待休息呼叫完成
- docker - 使用 Redis 向不安全的 docker 容器提供数据
- node.js - 不明白为什么我得到一个 TypeError: Cannot read property '_id' of undefined in React
- reactjs - React 中的受保护路由,不传递参数
- java - 来自字符串 java 的货币格式
- c# - 如何在发布时创建静态文件夹?
- ruby-on-rails - Rails 5 - 如何防止 Rails 将语言环境添加到构造路径上的 URL?
- tensorflow - TensorFlow Hparam 替换