I wrote a download box. Relative layout for layout files I wrote it. It is found that the width cannot be set on Android 11 devices. The layout controls are stacked together.
Solution:
1. Wrap the outermost layer with FrameLayout and match the width and height_ parent
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/bg"
android:layout_width="600dp"
android:layout_height="wrap_content"
android:background="@drawable/bg"
>
Other sub-controls
</RelativeLayout>
</FrameLayout>
Read More:
- [Solved] Flyter uses screenutil to obtain screen width and height initialization error
- error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘cv::imshow‘
- [Solved] Fluent filesysterexception: exists failed, path =’d: \ as’. Plugins’ (OS error: incorrect file name, directory name or volume slogan)
- Runtime error prompt in Android Studio: arrayadapter requires the resource ID to be a textview problem
- [Go] Solve the problem of exec: “gcc” executable file not found in %PATH% error when using cgo
- Solve the problem that the native machine cannot use ant script checkout project
- Implement base64_decode in GO language to solve the problem of illegal characters
- Kill Tomcat process in windows and Linux environment (solve the problem of other ports being occupied)
- Flash back problem when Android studio plays music in sdcard through intent
- Solve the VUE startup problem (You may use special comments to disable some warnings)
- [Nginx] Configure nginx to support websocket to solve the problem of returning 400 error
- [Solved] Click the play button to display: e/mediaplayer: error (1, – 2147483648)
- Android Package Error: AAPT: error: IDAT: incorrect data check. AAPT: error: file failed to compile.
- Win10 Right-Click desktop to Display Setting Error [How to Solve]
- The tree component in easyUI does not display data or displays undefined solutions
- System Startup and Display: [drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid
- Error starting ApplicationContext. To display the auto-configuration report re-run your application
- After SpringBoot starts, exit the console directly and display Process finished with exit code 1
- [Solved] Markdown Edit Formula Error: ParseError: KaTeX parse error: {align} can be used only in display mode