[英]What is the size of tab bar icon that works for Android and Ios in react native
I want to create custom icons in my tabbar (which created by react-native-router-flux ). 我想在我的标签栏中创建自定义图标(由react-native-router-flux创建 )。 Is there any restriction on the tab bar icon size in Ios and Android?
Ios和Android中的标签栏图标大小是否受到限制?
In Ios, the recommended size is 30 x 30 while in Android the suggestion is 24 x 24. 在Ios中,建议尺寸为30 x 30,而在Android中,建议尺寸为24 x 24。
I don't want to create the icons respectively, so I wonder is there icon size that works on both platform. 我不想分别创建图标,所以我想知道在两个平台上都可以使用的图标大小吗?
Different sizes work as well but like you said they wouldn't follow the platform's specific guidelines. 不同的大小也可以使用,但是就像您说的那样,它们不会遵循平台的特定准则。 I would define the icon size like this:
我将这样定义图标大小:
import { Platform } from 'react-native';
const dimensions = {
iconSize: (Platform.OS === 'ios') ? 30 : 24,
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.