On different devices, a different number of elements fit into the screen. What can be wrong ? Checked on sets of devices on 2 emulators and 7 different bodies. result of only 2: enter image description here

I use only these parameters

setLayoutManager(new LinearLayoutManager(view.getContext(), LinearLayoutManager.HORIZONTAL, false)); 

How can I display for example 4 or 3 elements so that all devices look the same

  • one
    Well, different devices have different sizes, including in relative units (dp). So it is normal that on different screens punches a different number of elements. And what's the difference how many fit, there is scrolling. If you really need to do exactly 3 elements, then set the size of the element view in the adapter when creating the view as a third of the screen programmatically. - xkor
  • @xkor, I'm just new to android and don't quite understand. unless there are no sizes for which the screen size does not depend on, like, “should they themselves fit under the screen and look the same? And there are many moments where on one so on the other so, and it’s not known how I will not have 3 for. difference in aesthetics - Artem
  • so they look the same, only equally not with respect to the screen size, but with respect to physical quantities, centimeter for example. and there are no sizes depending on screen sizes and there is no sense in them, they are not needed - xkor

0