如何使用像这样的图像这样的自定义图标使标签栏位于圆的中心?我正在使用反应本机导航。

react-native react-native-navigation wix-react-native-navigation
我正在使用React-native-navigation(wix),并且存在与React本机FAB(浮动操作按钮)相关的问题.
要求 - 我需要在componentDidMount生命周期方法中设置FAB,如下所示
componentDidMount() {
this.props.navigator.setButtons({
fab: {
collapsedId: "someFormName",
...getAddButtonStyle()
}
});
}
Run Code Online (Sandbox Code Playgroud)
我管理this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));全球,它按预期工作.我在这里遇到的问题是当我将其设置在内部时,FAB没有在我的UI中显示,componentDidMount()但如果我设置为 static button完美的工作.此外,它完美地完成了内部render()功能.
我很困惑,为什么我不能在componentDidMount()[初始页面加载] 内设置按钮?
android react-native react-native-android react-native-navigation wix-react-native-navigation
我正在用 react native 开发一个应用程序,并使用 react-native-navigation 库来创建一个底部选项卡。
在这里,我无法提供底部图标的大小。我现在正在使用大小为 25*25 的图标,这在高分辨率设备中是模糊的。当我使用较大的图标(例如 30*30)时,图标仅在 ios 中相互重叠。
react-native-navigation 库链接 - https://wix.github.io/react-native-navigation/#
以下是我浏览过的链接:-
https://github.com/wix/react-native-navigation/issues/3527#
https://github.com/wix/react-native-navigation/issues/4420
Navigation.setRoot({
root: {
bottomTabs: {
children: [
{
stack: {
id: Stackid.Stackid2,
children: [
{
component: {
name: ScreenId.Screen1Stack,
}
},
],
options: {
bottomTab: {
text: 'Tab1',
fontSize: 12,
icon: require('../assets/firstImage.png'),
iconColor:'red',
currentTabId: Stackid.Screen1,
selectedIconColor: 'green',
textColor: 'white',
selectedTextColor: 'green',
},
topBar: {
drawBehind: true,
visible: false,
animate: false,
},
statusBar: {
visible: true,
backgroundColor: 'grey',
drawBehind: false,
style: "light" …Run Code Online (Sandbox Code Playgroud) javascript react-native react-native-android react-native-ios wix-react-native-navigation
我们如何设置底部选项卡容器的样式react-native-navigation?例如,如果我们想增加垂直填充并更改顶部边框颜色?
我正在尝试react-native-navigation V2但无法更改状态栏颜色。
Navigation.setDefaultOptions({
statusBar: {
visible: true,
style: "dark",
backgroundColor: "red"
},
topBar: {
background: {
color: COLOR.primaryColor
},
title: {
text: "ExampleWix",
fontSize: 22,
color: "white"
},
visible: true
}
});
Run Code Online (Sandbox Code Playgroud)
但这仅在操作栏上起作用,而在状态栏上没有任何反应,它保持白色。我正在使用RN v = 0.54.2和react-native-navigation = 2.0.2373
更新
更新您的颜色RNN,您就可以更改status bar颜色
react-native react-native-navigation wix-react-native-navigation react-native-navigation-v2
我试图在react-native上向此入门项目添加一个路由器react native navigation v2,但是我遇到了与babel软件包有关的问题(可能是)。当我跑步
react-native run-android
Run Code Online (Sandbox Code Playgroud)
我在Metro Bundler中遇到此错误:
加载依赖图,完成。:捆绑失败:错误:[BABEL] D:\ react-native \ projecti \ index.js:预设选项中不允许.overr ides
在Object.keys.forEach.key(D:\ react-native \ projecti \ node_modules \ metro \ node odules \ Obabel \ core \ lib \ config \ validation \ options.js:71:13)在Array.forEach()在在实例化预设(D:\ react-native \ projecti \ node_modules \ metro \ node_modul s \ l @ babel \ core \ lib \ config \ full.js:242:36)在cachedFunction(D:\ react-native \ projecti \ node_modules \ metro \ node_modules \ babel \ core \ lib …
react-native react-native-navigation wix-react-native-navigation react-native-navigation-v2
如何使用 React-Native 禁用 Android 上的物理设备后退按钮?我不想为用户启用它。
react-native-navigation wix-react-native-navigation react-native-navigation-v2
我有TabBar基础应用程序,在我的一个标签中我需要将其推送到另一个屏幕,但标签栏不应显示在推动的屏幕中.但是底部栏仍然存在于推动的屏幕中.我想要实现的并不是完全隐藏底部标签栏,而是将推动的屏幕放在标签栏的顶部.
这是我显示标签栏应用程序的代码:
bottomTabs: {
id: 'BottomTabsId',
children: [
{
stack: {
children: [
{
component: {
name: 'Home',
options: {
topBar: {
backButton: {
title: 'Back',
},
title: {
text: 'Home'
}
},
bottomTab: {
fontSize: 12,
text: 'Home',
icon: require('./src/assets/home.png'),
selectedIcon: require('./src/assets/home_active.png')
},
},
},
}
]
}
},
{
stack: {
children: [
{
component: {
name: 'Booking',
options: {
topBar: {
title: {
text: 'Booking'
}
},
bottomTab: {
text: 'Booking',
fontSize: 12,
icon: require('./src/assets/booking.png'), …
react-native react-native-navigation wix-react-native-navigation react-native-navigation-v2
我的应用程序在React Native Navigation v1.0和react-native v0.56.0上运行。这在 Android 模拟器上运行得很好,没有任何问题。
最近,我计划按照ReactNative 页面中描述的步骤进行生产构建。
在使用命令生成发布 APK 时./gradlew assembleRelease,最终我抛出了错误 - File not found: index.android.js in any of the project roots;但我的项目由index.js组成,而不是index.android.js。
在 Wix Git 上获得帮助的可能性较小,因为他们现在对 v1.0 的关注较少。所以,我希望能找到一条出路。
这是我的MainApplication.java内容:
import android.support.annotation.Nullable;
import com.facebook.react.ReactPackage;
import com.reactnativenavigation.NavigationApplication;
import java.util.Arrays;
import java.util.List;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.oblador.vectoricons.VectorIconsPackage;
public class MainApplication extends NavigationApplication {
@Override
public boolean isDebug() {
return BuildConfig.DEBUG;
}
@Nullable
@Override
public List<ReactPackage> createAdditionalReactPackages() {
return Arrays.<ReactPackage>asList(
new PickerPackage(),
new VectorIconsPackage()
);
}
@Nullable …Run Code Online (Sandbox Code Playgroud) react-native react-native-navigation wix-react-native-navigation
我正在使用 wix 的 react native navigation v2。我有一个带有登录屏幕和注册的欢迎屏幕。我从App.js. 有登录和注册两个选项卡。
但是一旦应用程序启动,componentWillMount 方法就会在注册屏幕中运行,但我仍处于登录选项卡。
为什么会这样?
是否可以更改react-native-navigation标签栏中的图标?
我的意思是,例如,在我的应用程序中我确实调用了api,并且在响应到来之后,我需要将Icon标签栏更改为新的。
例如Heart图标到Mail图标。
感谢任何帮助!
react-native react-native-navigation wix-react-native-navigation