Anonymous
Реагирует на встроенный элемент заголовка навигации expo@sdk52 при нажатии не работает
Сообщение
Anonymous » 06 дек 2024, 07:19
Навигационный заголовок onPress не работает на устройстве iOS. После обновления до последней версии SDK52 мое приложение перестало работать на устройствах iOS, хотя раньше оно работало нормально как на iOS, так и на Android. В частности, кнопка onPress заголовка навигации, компоненты pressable и TouchableOpacity работают неправильно в iOS.
У кого-нибудь есть такая же проблема?
Я нажал 10 раз, прежде чем onPress сработал.
Iphone 7, IOS 15.8.3
package.json
Код: Выделить всё
{
"name": "qr_logistics",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"@expo/prebuild-config": "~8.0.0",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "^8.2.0",
"@react-native-community/netinfo": "^11.4.1",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"@shopify/flash-list": "^1.7.1",
"axios": "^1.7.2",
"babel-plugin-module-resolver": "^5.0.2",
"base-64": "^1.0.0",
"create-react-class": "^15.7.0",
"crypto-js": "^4.1.1",
"eas-cli": "^0.49.0",
"expo": "^52.0.7",
"expo-barcode-scanner": "~13.0.1",
"expo-build-properties": "^0.13.1",
"expo-camera": "~16.0.5",
"expo-checkbox": "~4.0.0",
"expo-constants": "~17.0.3",
"expo-image-picker": "~16.0.2",
"expo-linking": "~7.0.2",
"expo-localization": "~16.0.0",
"expo-location": "~18.0.1",
"expo-secure-store": "~14.0.0",
"expo-sqlite": "~15.0.3",
"expo-status-bar": "~2.0.0",
"metro-react-native-babel-preset": "^0.77.0",
"project-can-json": "^1.0.1",
"project-react-accordion": "^1.0.4",
"project-react-mvc": "^1.6.0",
"project-rest-client": "^1.3.3",
"react": "^18.3.1",
"react-native": "^0.76.2",
"react-native-check-version": "^1.1.1",
"react-native-device-info": "^10.13.1",
"react-native-dotenv": "^3.4.9",
"react-native-fetch-api": "^3.0.0",
"react-native-get-random-values": "~1.11.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-reanimated": "~3.16.1",
"react-native-render-html": "^6.3.4",
"react-native-safe-area-context": "^4.12.0",
"react-native-screens": "~4.1.0",
"react-native-sse": "^1.2.1",
"react-native-store-version": "^1.4.1",
"react-native-url-polyfill": "^2.0.0",
"react-native-webview": "^13.12.2"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}
рабочий код
Код: Выделить всё
let NavigationContent = () => sisu;
let btn =
{
alert('sa');
//this.props.navigation.goBack()
}}>
tagasi
;
let ScreenOptions = {
headerStyle: {},
orientation: 'all',
headerShown: false,
presentation: 'card',
animationTypeForReplace: 'push',
animation: 'fade_from_bottom',
};
let NavigationOptions = ({navigation, route}) => {
return {
...ScreenOptions, ...{
headerBackTitle: null,
headerTitle: props => null,
//if header back button not needed then set to null
headerLeft: props => btn,
//if header right not needed then set to null
headerRight: props => btn,
tabBarVisible: false,
headerShown: true,
headerReloadOnFocus: true
}
};
};
return (
({
focus: (e) => {
global.navigationRoute = route;
},
})}/>
);
тема также есть:
https://github.com/expo/expo/issues/32927
Подробнее здесь:
https://stackoverflow.com/questions/792 ... s-not-work
1733458742
Anonymous
Навигационный заголовок onPress не работает на устройстве iOS. После обновления до последней версии SDK52 мое приложение перестало работать на устройствах iOS, хотя раньше оно работало нормально как на iOS, так и на Android. В частности, кнопка onPress заголовка навигации, компоненты pressable и TouchableOpacity работают неправильно в iOS. У кого-нибудь есть такая же проблема? Я нажал 10 раз, прежде чем onPress сработал. Iphone 7, IOS 15.8.3 package.json [code]{ "name": "qr_logistics", "version": "1.0.0", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web" }, "dependencies": { "@expo/prebuild-config": "~8.0.0", "@react-native-async-storage/async-storage": "1.23.1", "@react-native-community/datetimepicker": "^8.2.0", "@react-native-community/netinfo": "^11.4.1", "@react-navigation/native": "^6.1.6", "@react-navigation/native-stack": "^6.9.12", "@shopify/flash-list": "^1.7.1", "axios": "^1.7.2", "babel-plugin-module-resolver": "^5.0.2", "base-64": "^1.0.0", "create-react-class": "^15.7.0", "crypto-js": "^4.1.1", "eas-cli": "^0.49.0", "expo": "^52.0.7", "expo-barcode-scanner": "~13.0.1", "expo-build-properties": "^0.13.1", "expo-camera": "~16.0.5", "expo-checkbox": "~4.0.0", "expo-constants": "~17.0.3", "expo-image-picker": "~16.0.2", "expo-linking": "~7.0.2", "expo-localization": "~16.0.0", "expo-location": "~18.0.1", "expo-secure-store": "~14.0.0", "expo-sqlite": "~15.0.3", "expo-status-bar": "~2.0.0", "metro-react-native-babel-preset": "^0.77.0", "project-can-json": "^1.0.1", "project-react-accordion": "^1.0.4", "project-react-mvc": "^1.6.0", "project-rest-client": "^1.3.3", "react": "^18.3.1", "react-native": "^0.76.2", "react-native-check-version": "^1.1.1", "react-native-device-info": "^10.13.1", "react-native-dotenv": "^3.4.9", "react-native-fetch-api": "^3.0.0", "react-native-get-random-values": "~1.11.0", "react-native-keyboard-aware-scroll-view": "^0.9.5", "react-native-reanimated": "~3.16.1", "react-native-render-html": "^6.3.4", "react-native-safe-area-context": "^4.12.0", "react-native-screens": "~4.1.0", "react-native-sse": "^1.2.1", "react-native-store-version": "^1.4.1", "react-native-url-polyfill": "^2.0.0", "react-native-webview": "^13.12.2" }, "devDependencies": { "@babel/core": "^7.20.0" }, "private": true } [/code] рабочий код [code]let NavigationContent = () => sisu; let btn = { alert('sa'); //this.props.navigation.goBack() }}> tagasi ; let ScreenOptions = { headerStyle: {}, orientation: 'all', headerShown: false, presentation: 'card', animationTypeForReplace: 'push', animation: 'fade_from_bottom', }; let NavigationOptions = ({navigation, route}) => { return { ...ScreenOptions, ...{ headerBackTitle: null, headerTitle: props => null, //if header back button not needed then set to null headerLeft: props => btn, //if header right not needed then set to null headerRight: props => btn, tabBarVisible: false, headerShown: true, headerReloadOnFocus: true } }; }; return ( ({ focus: (e) => { global.navigationRoute = route; }, })}/> ); [/code] тема также есть: https://github.com/expo/expo/issues/32927 Подробнее здесь: [url]https://stackoverflow.com/questions/79256828/react-native-exposdk52-navigation-header-element-onpress-does-not-work[/url]