android - 如何在 android 中制作 IconButton?
问题描述
在使用 react native 很长一段时间后,我正在研究 android,但我似乎在 android 中找不到任何关于 IconButtons 的信息,比如这里的:
https://callstack.github.io/react-native-paper/icon-button.html
谢谢
解决方案
ImageButton
它在Android中称为an 。
<ImageButton
android:id="@+id/favorite_imageButton"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginTop="@dimen/margin_extra_small"
android:layout_marginEnd="@dimen/margin_extra_small"
android:layout_marginBottom="@dimen/margin_extra_small"
android:background="?selectableItemBackgroundBorderless"
android:padding="@dimen/margin_extra_small"
android:src="@drawable/ic_star_border"
android:tint="?attr/colorOnBackground"
app:layout_constraintBottom_toBottomOf="@id/up_navigation_imageButton"
app:layout_constraintRight_toLeftOf="@id/game_link_imageButton"
app:layout_constraintTop_toTopOf="@id/up_navigation_imageButton"
tools:src="@drawable/ic_star_border" />
推荐阅读
- random - 有谁知道任何基于分形几何定律的prng?
- parsing - Log Parser Studio 查询 - 最近访问的 IP 地址?
- java - 在“一对多映射”场景中对子实体的 findById 操作返回递归子实体。需要解决方案
- php - PHP:如何将变量值更改为另一个类
- css - 如何扩展绝对放置的伪元素,直到页面内容变得最好?
- d3.js - 使用 D3.js 构建平面日历
- python - 将csv中的字符串解析为字典
- javascript - TamperMonkey 可以创建书签吗?
- google-cloud-run - 如何在 Google Cloud Run 上运行 WordPress?
- python - numpy总和比字符串计数慢