A amer bashar Member Licensed User Oct 17, 2021 #1 Hi, for implementing change how my app looks if screen orientation changed , I followed this steps : 1- add this line to manifest to stop activity from create: B4X: Copy SetActivityAttribute(Main, android:configChanges, "orientation|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation") 2- in main : B4X: Copy #SupportedOrientations: unspecified 3- using GetDeviceLayoutValues for detecting orientation changes: B4X: Copy Sub timerorient_tick() If GetDeviceLayoutValues.Width > GetDeviceLayoutValues.Height Then CheckScrOrientation = "Landscape" Else CheckScrOrientation = "Portrait" End If If CheckScrOrientation <> StoredOrientation Then StoredOrientation = CheckScrOrientation Root.RemoveAllViews Root.Width=GetDeviceLayoutValues.Width Root.Height=GetDeviceLayoutValues.Height Root.LoadLayout("my_layout") End If End Sub The problem is that the app don`t show all the root width or height, I mean the ROOT width and height changes correctly but the app not showing all the page some area is missing ! it using the old dimensions for showing the corrected dimensions root , I can`t explain it well the screenshot explained it Please notice the second screenshot that the components are displayed on their correct locations this means that the root width is correct! your help is so appreciated Attachments Screenshot_20211017-154243[1].jpg 418 KB · Views: 434 Screenshot_20211017-154257 copy.jpg 364 KB · Views: 387
Hi, for implementing change how my app looks if screen orientation changed , I followed this steps : 1- add this line to manifest to stop activity from create: B4X: Copy SetActivityAttribute(Main, android:configChanges, "orientation|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation") 2- in main : B4X: Copy #SupportedOrientations: unspecified 3- using GetDeviceLayoutValues for detecting orientation changes: B4X: Copy Sub timerorient_tick() If GetDeviceLayoutValues.Width > GetDeviceLayoutValues.Height Then CheckScrOrientation = "Landscape" Else CheckScrOrientation = "Portrait" End If If CheckScrOrientation <> StoredOrientation Then StoredOrientation = CheckScrOrientation Root.RemoveAllViews Root.Width=GetDeviceLayoutValues.Width Root.Height=GetDeviceLayoutValues.Height Root.LoadLayout("my_layout") End If End Sub The problem is that the app don`t show all the root width or height, I mean the ROOT width and height changes correctly but the app not showing all the page some area is missing ! it using the old dimensions for showing the corrected dimensions root , I can`t explain it well the screenshot explained it Please notice the second screenshot that the components are displayed on their correct locations this means that the root width is correct! your help is so appreciated
agraham Expert Licensed User Longtime User Oct 17, 2021 #2 amer bashar said: 1- add this line to manifest to stop activity from create: Click to expand... Why? Just have portrait and landscape variants in your layout file. Upvote 0
amer bashar said: 1- add this line to manifest to stop activity from create: Click to expand... Why? Just have portrait and landscape variants in your layout file.
A amer bashar Member Licensed User Oct 17, 2021 #3 agraham said: Why? Just have portrait and landscape variants in your layout file. Click to expand... These variant tells what is the current situation (portrait or landscape ) ok very good, but the problem is about something else , its about how to resize the root or the layout to the correct dimensions . also all my views have the AutoScaleAll but with the same result , also if I tried to resize components in the designer script every thing to 100%x width and height , always with the same result mentioned in my screenshots above please Help !! Upvote 0
agraham said: Why? Just have portrait and landscape variants in your layout file. Click to expand... These variant tells what is the current situation (portrait or landscape ) ok very good, but the problem is about something else , its about how to resize the root or the layout to the correct dimensions . also all my views have the AutoScaleAll but with the same result , also if I tried to resize components in the designer script every thing to 100%x width and height , always with the same result mentioned in my screenshots above please Help !!
agraham Expert Licensed User Longtime User Oct 17, 2021 #4 Sorry, but I don't understand what your problem is. Post a small project that shows the problem. Upvote 0