Reputation: 67
I am using capacitor for building this iOS app but the content displayed over safe area. I have used many css in app-header or body tag. But none of them are working. I also installed a plugin named capacitor-plugin-safe-area but can understand what to do after reading their documentation.
I am using angular 11 for front end and .net core for back end api.
Upvotes: 3
Views: 2938
Reputation: 1804
pHorekka's answer helped me a lot, this is my working example for the react.js:
capacitor.config.json
{
"appId": "com.your.app",
"appName": "Your App Name",
"webDir": "dist",
"ios": {
"contentInset": "always"
}
}
Upvotes: 0
Reputation: 5951
You're looking for safe-area-inset-*
padding-top: env(safe-area-inset-top);
Keep in mind that Capacitor has a plugin for more status bar options like light/dark mode.
Upvotes: 2
Reputation: 125
Make changes to capacitor.config file :
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.company.appname',
appName: 'My Capacitor App',
webDir: 'www',
ios: {
contentInset: 'always',
},
};
export default config;
Add contentInset property as 'always' for ios devices.
Upvotes: 6