-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
底部的图标无法居中 #8
Comments
@Lcn29 你应该是设置了flex:1,用布局查看器看看控件的大小吧 |
@yuanguozheng |
@Lcn29 试试在父View上用alignItems:center |
@Lcn29 看了一下,应该是TabNavigation内部的控制有点问题,暂时先用bottom这种办法搞吧 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
底部图标无法上下居中,按照楼主?(不知道叫什么好,233)图标能居中是通过 marginTop: 12.5 将图标挤下来,但是在我这里不起作用
是tab-navigator的版本不一样造成的吗?刚学习RN 太懂,有什么方法可以让图标居中的
下面代码
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
Image
} from 'react-native';
import Header from './Header';
import TabNavigator from 'react-native-tab-navigator';
const HOME = 'home';
const HOME_NORMAL = require('./image/tabs/home_normal.png');
const HOME_FOCUS = require('./image/tabs/home_focus.png');
const CATEGORY = 'category';
const CATEGORY_NORMAL = require('./image/tabs/category_normal.png');
const CATEGORY_FOCUS = require('./image/tabs/category_focus.png');
const FAXIAN = 'faxian';
const FAXIAN_NORMAL = require('./image/tabs/faxian_normal.png');
const FAXIAN_FOCUS = require('./image/tabs/faxian_focus.png');
const CART = 'cart';
const CART_NORMAL = require('./image/tabs/cart_normal.png');
const CART_FOCUS = require('./image/tabs/cart_focus.png');
const PERSONAL = 'personal';
const PERSONAL_NORMAL = require('./image/tabs/personal_normal.png');
const PERSONAL_FOCUS = require('./image/tabs/personal_focus.png');
export default class MainScreen extends Component {
}
const styles = StyleSheet.create({
tab: {
height: 52,
backgroundColor: '#303030',
alignItems: 'center',
},
tabIcon: {
width: 30,
height: 35,
resizeMode: 'stretch',
marginTop: 12.5
}
});
The text was updated successfully, but these errors were encountered: