skip to Main Content

I created new login page in android studio. that activity xml looks good on Emulator but in real time mobile its looks like irregular alignments what can I do for that? I used Linear layout for that.

2

Answers


  1. Most probably you hard-coded pixels, try converting to ConstrainsLayout. 1 LinerLayout can not provide enough flexibility if the layout is not simple.

    Login or Signup to reply.
  2. The most efficient solution is to use ConstraintLayout.
    ConstraintLayout has a flat view hierarchy, unlike other layouts, so it performs better than various other layouts. Only a single layout can handle your UI.

    Or you may use a RelativeLayout, and then use LinearLayout as a child inside RelativeLayout, i.e., you will need to create a hierarchy with some nested views, which will adversely affect performance.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search