angular - 工具栏/离子按钮外的 Ionic 4 圆形图标仅按钮
问题描述
如何在离子按钮之外创建一个圆形、清晰、仅图标的按钮?我想要一个按钮,当您使用时,您获得的样式和内部只有图标的按钮ion-buttons
(例如清晰和圆形)。到目前为止我的代码:
<ion-button icon-only shape="round" color="white" fill="clear">
<ion-icon slot="icon-only" name="close"></ion-icon>
</ion-button>
生成的按钮不是圆形的,它只是一个带圆角的矩形按钮。
ionic 4 文档没有提到如何做到这一点。
解决方案
FabButton 可以工作...但这是我在 reactjs 应用程序中使用离子组件的方法,只需使用角度版本,您应该会得到相同的结果
<IonCard>
<IonToolbar>
<IonTitle>Test</IonTitle>
<IonButtons slot="end">
<IonButton
style={{
backgroundColor: "red",
borderRadius: "100%",
color: "white",
width: 32
}}
>
<IonIcon icon={close}></IonIcon>
</IonButton>
</IonButtons>
</IonToolbar>
<IonCardContent>
This is some text that is the content of the card with the close
button below
</IonCardContent>
</IonCard>
推荐阅读
- java - 从流中的最后一个跳过
- arrays - 如何在 Robo3T 中将结果从一个查询传递到另一个查询
- javascript - 当页面被添加书签时添加查询参数
- azure-log-analytics - 如何透视日志分析数据 (Kusto)
- apache-nifi - Apache Nifi 无法使用 zookeeper 字符串中的多个注释
- android - 如何使 RecyclerView 的适配器显示添加按钮作为最后一行?
- nao-robot - NAO Robot:如何重写qi框架的声音处理示例?
- reactjs - 在 Gitgraph 中为特定提交的节点设置颜色
- c++ - While循环比较大小而不是数量
- lua - ZeroBrane 与 Lua 5.4