Questions tagged [safearea]
42 questions
5
votes
1 answer
Flutter SafeArea: avoid notches, but ignore rounded corners
Is there a way to detect and avoid notches in a phone's screen (for example, the camera notch in an iPhone X), but ignore a screen's rounded corners?
For example, here's my app in landscape mode on an iPhone with a notch:
The menu on the left is…

Nathan Friend
- 12,155
- 10
- 75
- 125
5
votes
2 answers
How to access safeArea insets while the parent view used IgnoringSafeArea()
As you can see the picture I want to place the search bar exactly to the top of the safeArea but the proxy.safeAreaInsets has not the proper value because in the PreviewProvider the parent uses edgesIgnoringSafeArea.
what can I do ? is there any way…

Behrad Kazemi
- 302
- 1
- 10
4
votes
0 answers
Disable keyboard avoidance in a bottom sheet
TLDR: The view modifier .ignoresSafeArea(.keyboard) does not appear to work when used inside a bottom sheet. Is there a workaround?
In a SwiftUI View, tapping a TextField invokes the keyboard and the Textfield then moves upwards to avoid the…

Dave Robertson
- 431
- 3
- 6
4
votes
2 answers
SwiftUI add `menu` in `.safeAreaInset` cause strange layout issue
Here is the sample project source code: sample code
import SwiftUI
struct TestMenuInSafeAreaInset: View {
@State private var message = ""
var body: some View {
VStack {
Rectangle()
.fill(Color.blue)
…

ZYiOS
- 5,204
- 3
- 39
- 45
3
votes
3 answers
Positioning custom AppBar without SafeArea
I am trying to create a custom AppBar, with a polygon instead of the bar, I already have something:
As you can see, on some screens the bar is to high, because the SafeArea differs. I did not use:
child: Scaffold(
appBar: MyCustomBar(),
…

Emaborsa
- 2,360
- 4
- 28
- 50
3
votes
2 answers
How to extend a MapKit's Map beyond NavigationBar and TabBar in SwiftUI?
I am working on a SwiftUI app which uses both TabView and NavigationView. One of the views is responsible for presenting a Map from MapKit and it is meant to take all available space. I would like it to extend beyond TabBar and NavigationBar, so…

Kamil Chmielewski
- 33
- 6
3
votes
1 answer
How to apply a dynamic rotation to a map using SwiftUI
So I'm using Mapbox, and I don't want to use the userTrackingMode = .followWithHeading as this causes way too much lag on my device as you rotate it. Instead, I'd like to maybe incorporate the .rotationEffect(Angle(degrees: degree)) SwiftUI…

nickcoding2
- 142
- 1
- 8
- 34
2
votes
4 answers
Extend bottom navigation bar over safe area
I have the following screen
and this is the code:
return Scaffold(
backgroundColor: Palette.light,
body: RefreshIndicator(
onRefresh: () => MatchesController.refresh(matchesState, matchId),
child:…

alexlipa
- 1,131
- 2
- 12
- 27
2
votes
2 answers
Flutter change bottom nav bar height
I am trying to build a custom bottomNavBar and my code looks like this:
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
decoration:…

Chris
- 1,828
- 6
- 40
- 108
1
vote
0 answers
Is there a way to preventing an Expo React Native app from generating safe areas?
I was testing my app with Expo Go, but when I tried to build a preview APK I had to install some dependencies that apparently are required from @react-navigation/native, such as react-native-safe-area-context. But now that everything with my build…

João Pedro Santos
- 11
- 2
1
vote
2 answers
Flutter : get appbar's height - Iphone 14 Pro Max
I have an appbar in my flutter app.
I'm use an padding to display a container
Padding(
padding: const EdgeInsets.only(
top: kToolbarHeight + kTextTabBarHeight,)
With Android and all iphone devices, that's ok like this image
But with Iphone pro 14…

redDwarf
- 336
- 1
- 9
1
vote
3 answers
Why is the Safe Area in React PWA is always 0px?
Hi I'am building a PWA with react and I've been trying to add a padding to my Footer to avoid the safe area, but for some reason it's always 0px;
I have these tags in HTML:

Hiimdjango
- 431
- 5
- 21
1
vote
1 answer
Unity SafeArea is inconsistent between different starting rotations
I'm trying to make a script that adjusts the SafeArea of my Canvas when the device is rotated. I've got it almost working and it looks great on-launch, but I'm getting a weird result after rotating that I can't understand: the SafeArea is different…

Nerrolken
- 1,975
- 3
- 24
- 53
1
vote
2 answers
How to move this to the top?
I just learned how to implement specific rounded corners, but now it seems nothing will align to the top of the screen, even with spacers. How can I get it to align to the top of the screen?
Additionally, I would like the green to ignore the top…

Owen Lewis
- 35
- 6
1
vote
1 answer
Detect screen notch from prefersStatusBarHidden
There are many question on StackOverflow about detecting whether an iPhone device has a notch in the screen, such as this one. The answers almost always recommend using the safeAreaInsets property of the top window. I have used that in my app to…

fishinear
- 6,101
- 3
- 36
- 84