callstack / callstack/react-native-paper

Icon in IconButton not centered and cannot be centered

未关闭
#4,829 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug Icon Button
主要语言
TypeScript
星标
14.5k
派生
2.2k
平均合并
5 天 23 小时
30 天内合并 PR
12

描述

### Current behaviour
Icon in IconButton is not centered

### Expected behaviour
Icon to be centered

### How to reproduce?
Add background color to IconButton using the style prop.

### Preview

Image

### What have you tried so far?
Adding `alignItems: 'center'` and `justifyContent: 'center'` to both `style` and `contentStyle`. `style` aligned the trash can icon a little bit horizontally, but it was still off.

Adding `backgroundColor` to both `style` and `contentStyle`.

### Your Environment

| software | version
| --------------------- | -------
| ios | x
| android | 13
| react-native | 0.82.1
| react-native-paper | 5.14.5
| node | 22.11.0
| npm or yarn | x.x.x
| expo sdk | x.x.x

贡献指南

打开贡献指南

调研方向

首先,使用 issue 中列出的版本,通过 style 提供 backgroundColor,在 Android 上复现 IconButton 布局。跟踪 IconButton 的实现及其图标容器,以确定图标边界为何发生偏移;当按钮具有通过样式设置的背景时图标能够居中,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
react-native, typescript
领域
frontend, mobile
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。