0

I have a fragment in which, when in landscape mode need to show another layout, while in portrait another layout? Is there any way to achieve this behaviour?

My requirement is my bottom menu should be locked in portrait even when the orientation changes.

As my center view has been rotated, others are not changed.

Is it possible in android, if yes, how to implement it?

Dokksen
  • 372
  • 1
  • 4
  • 17
gH057
  • 1
  • 1
  • Refer: https://stackoverflow.com/q/582185/9636037. Is your question the same as that one? – Abhimanyu Aug 21 '20 at 08:01
  • no actually, I have a layout(resembiling a bottom menu) aligned to bottom inside the fragment which gets rotated on landscape mode, so is there any way to restrict that rotation of that particular view? – gH057 Aug 21 '20 at 08:26

1 Answers1

0

In your res folder, create layout-land folder. Create an xml layout file with the same name as the layout you are currently using for your fragment. In the newly created layout file, define your landscape layout.

Dat Pham Tat
  • 1,433
  • 7
  • 9
  • actually i have tried that ,when orientation changes it is not using that layout in land-layout folder. i have used the same name as the layout im currenty using in portrait. – gH057 Aug 22 '20 at 13:32