小编Luc*_*ira的帖子

如何在同时使用safeAreaView时删除React Native StackNavigator的内部阴影

我正在使用import { SafeAreaView } from 'react-native';新的iPhone X开发,但我在该区域内得到一个无聊的阴影.我该如何删除它?

图像就在这里

// Code

import { SafeAreaView } from 'react-native';

<SafeAreaView style={styles.safeArea}>
 ...
</SafeAreaView>


// Style
safeArea: {
  flex: 1,
  backgroundColor: colors.background,
},
Run Code Online (Sandbox Code Playgroud)

更新:我发现可能与StackNavigator存在某种冲突(使用headerMode:'none').当我的代码中没有safeAreaView时,堆栈会正确隐藏标题.

更新2: @Julien Malige,这就是我的观点.TKS 在此输入图像描述

shadow react-native iphone-x

6
推荐指数
1
解决办法
2419
查看次数

MapAnnotation 按钮操作不起作用(SwiftUI 2.0 地图)

我只是想触摸地图注释,但按钮的操作不起作用。我试图弄清楚如何解决它,但到目前为止还没有。我想在不制作 UIKit 桥的情况下使用 Map。

这是我的地图:

Map(coordinateRegion: $locationManager.currentLocation,
    interactionModes: .all,
    showsUserLocation: true,
    userTrackingMode: $trackingMode,
    annotationItems: $locationManager.annotations.wrappedValue) { location in
        MapAnnotation(coordinate: location.coordinate, anchorPoint: CGPoint(x: 0.5, y: 0.5)) {
            MapAnnotationView(name: location.title, image: Image("dog"))
        }
    }
Run Code Online (Sandbox Code Playgroud)

这是我的 MapAnnotationView:

import SwiftUI

struct MapAnnotationView: View {
    var name: String
    var image: Image
    @State var size: CGFloat = 20

    var body: some View {
        VStack {
            Button(action: {
                size = $size.wrappedValue == 20 ? 60 : 20
                print("TAPPED =====>")
            }, label: {
                image
                    .resizable(capInsets: EdgeInsets(), resizingMode: .stretch) …
Run Code Online (Sandbox Code Playgroud)

mapkit swift swiftui

6
推荐指数
0
解决办法
213
查看次数

标签 统计

iphone-x ×1

mapkit ×1

react-native ×1

shadow ×1

swift ×1

swiftui ×1