react-native-vision-camera
react-native-vision-camera copied to clipboard
❓ Camera View not show in Full Screen
Question
How to show camera in full screen in android in Every Device in some device it's not show in full screen leave space Right or Bottom Side Please Give suggestion for this it's look like this
Any solution to resolve it?
What I tried
I tried "flex:1" in styles as well as "StyleSheet Absolute Fill" and "height width 100%" and also remove parent view also
VisionCamera Version
2.13.3
Additional information
- [ ] I am using Expo
- [X] I have read the Troubleshooting Guide
- [X] I agree to follow this project's Code of Conduct
- [X] I searched for similar questions in the issues page as well as in the discussions page and found none.
Hey, never seen that issue before - but it looks like a layout issue. Does it work if you replace the <Camera>
with a normal <View>
and give it a background color?
@mrousavy i have the same issue on android and yes it work when replace <Camera> with normal <View>
I got this issues
@truongngodang any solution?
Yes. Send me your android manifest file source code I will let you know
Manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="xxx">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<!-- optionally, if you want to record audio: -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- storage -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:requestLegacyExternalStorage="true" android:largeHeap="true" android:hardwareAccelerated="false" android:usesCleartextTraffic="true" android:allowBackup="false" android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:theme="@style/AppTheme">
<!-- facebook -->
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" />
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token" />
<activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" />
<activity android:name="com.facebook.CustomTabActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<!-- end facebook -->
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- maps sdk -->
<meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/maps_sdk" />
</application>
</manifest>
Manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="xxx"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.CAMERA" /> <!-- optionally, if you want to record audio: --> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <!-- storage --> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <application android:requestLegacyExternalStorage="true" android:largeHeap="true" android:hardwareAccelerated="false" android:usesCleartextTraffic="true" android:allowBackup="false" android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:theme="@style/AppTheme"> <!-- facebook --> <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" /> <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token" /> <activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" /> <activity android:name="com.facebook.CustomTabActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="@string/fb_login_protocol_scheme" /> </intent-filter> </activity> <!-- end facebook --> <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <!-- maps sdk --> <meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/maps_sdk" /> </application> </manifest>
you need to remove android:hardwareAccelerated="false" from this file then after it's working perfectly in my app I hope this solution also work for you.
I tried this way, its worked. thank you.
Closing as this is a stale issue - this might have been fixed with the full rewrite in VisionCamera V3 (🥳) - if not, please create a new issue.