- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 react-navigator 创建屏幕,但是当屏幕打开时我无法更改标题栏的选项
我的代码(App.js):
function App() {
return (
<NavigationContainer>
<Stack.Navigator screenOptions={{
headerTitleAlign: 'center',
headerTitle: props => <LogoTitle {...props} />,
headerRight: props => <HeaderRight {...props} />,
headerStyle: {
backgroundColor: '#F46A0D'
},
headerTintColor: '#fff',
}}>
<Stack.Screen name="Search" component={SearchScreen}/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;
import React from 'react'
import { Text, View } from 'react-native'
import { Button } from 'react-native-paper'
const SearchScreen = ({ navigation }) => {
navigation.setOptions = {
headerTitle: props => <TextInput {...props} placeholder="Search" placeholderTextColor="#FFFF" style={{
fontSize: 24
}}></TextInput>,
headerRight: props => <FontAwesome5 {...props} name={'search'} size={22} color="white" style={{ marginRight: 15 }}></FontAwesome5>
}
return (
<View>
</View>
)
}
export default SearchScreen;
最佳答案
在路由文件上
<Stack.Screen
name="FuncName"
component={FuncName}
options={{
headerTitle:''
}}/>
在按下去 FuncName 屏幕
onPress={()=>{
props.navigation.navigate("FuncName",{title:"title"})
}}
然后通过 Prop 标题更改标题
const FuncName = (props) => {
useEffect(()=>{
props.navigation.setOptions({ headerTitle: props.route.params.title })
},[])
}
关于react-native - navigation.setOptions 不会改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61370729/
我已收到以下代码以添加到封闭代码(受密码保护)中,以便可以发现错误。 On Error Resume Next: Err.Clear Application.SetOption "Error Trap
我正在尝试自定义我的 zsh 提示,并希望在每次生成提示时使用 git 命令评估一个函数。我正在使用 setopt PROMPT_SUBST ,但它似乎没有工作。这是我的 zshrc: setopt
我正在尝试设置套接字的SO_KEEPALIVE时间。 我创建了一个类 SocketBuilder 来使用 SocketImpl 构建套接字实例。源代码如下, public class SocketBu
在 ZSH 中,我在命令行运行它: $ setopt listambiguous 然后我运行 setopt 来获取当前选项的列表: $ setopt 它不在列表中。为什么不? 最佳答案 默认情况下
我需要从内核空间更改 TCP 套接字(尽管我想保持它的通用性)。 USB 驱动程序将收到一条消息,需要对给定的 socket 结构进行此更改。 直接调用该函数需要用户空间内存,我无法在生产环境中使用变
我必须使用事务来设置和更新 Firestore 中的某些数据。如果旧数据已经存在,我想合并新数据。这在没有交易的情况下是可能的,但有了它们我似乎无法做到这一点,即使它说你可以。 从 Flutter F
我在 Windows 7 中安装了三个客户端证书,需要使用一个特定的证书来验证使用 VBA 的 ServerXMLHTTP60 调用。 使用证书的友好名称调用 ServerXMLHTTP60.SetO
我正在使用 react-navigator 创建屏幕,但是当屏幕打开时我无法更改标题栏的选项 我的代码(App.js): function App() { return (
所以我有这个函数可以在用户成功注册后将用户存储到Firestore中。 //User class id: String email: String? displayName: String? phot
我正在使用 vis.js 来显示网络节点。我正在解析 JSON 中的节点数据并将其存储在数组中: $.each(jsonObj, function(i, val) { var itemId
我是一个新手,试图创建一个基于 poloniex.js API 的应用程序,但出现错误-TypeError:curl.setopt 不是函数] set node-curl(不工作)和 node-lib
我正在使用 PyCurl 发送带有文件附件的 POST 请求: d = pycurl.Curl() d.setopt(pycurl.URL, url) # d.setopt(pycurl.RETURN
我们目前正在使用 DotNet.Highcharts API 将 Highcharts 合并到我们的网站中。但是,在使用 .SetOptions(GlobalOptions) 调用时,我们遇到了一些
我正在尝试使用 Vue2 对 highcharts 进行标准翻译,但我遇到了困难,因为我无法访问 setOptions 选项。我没有找到太多关于 Highcharts 的 vue2 文档,所以我在使用
我正在尝试使用 Vue2 对 highcharts 进行标准翻译,但我遇到了困难,因为我无法访问 setOptions 选项。我没有找到太多关于 Highcharts 的 vue2 文档,所以我在使用
我在创建新的谷歌地图时设置了深色背景。事实证明,当用户更改为“街道模式”时,背景会自动更改。因此,当用户回到“正常模式”时,背景保持白色。 我希望能够将背景改回深色,但 setOptions() 方法
如果服务器启用了 php libcurl,它是否具有所有可用的 setopt 选项(当然,除非在新的 libcurl 版本中添加了一些新内容并且服务器没有升级),或者管理员是否可以关闭部分功能? 我特
我偶然发现了这个,从那以后它就一直困扰着我: % setopt alwaystoend autocd autonamedirs ... sharehistory shinstdin zle % % s
我已更新 Firestore 如下。现在,我不能再使用它了。我删除,重新安装了几次。但是没有变化。我快疯了。问题是: "Use of unresolved identifier 'SetOptions
首先,我想道歉,我提供了这么多信息,以尽可能清楚地说明问题所在。如果还有什么需要澄清的,请告诉我。 (运行erlang R13B04,内核2.6.18-194,centos 5.5) 我有一个很奇怪的
我是一名优秀的程序员,十分优秀!