skip to Main Content

I am learning Android Studio.

Making a calculator.

Why is everything (Summ button and fields for num 1, 2 and result) in one heap in the Android Studio emulator?

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    One need to add ConstraintLayout to the white field in design mode (where your text and button are).

    Then choose the element, rightclick it -> Constraint: parent top, bottom, start, end. Then change numbers and drag the sliders (marked with blue).

    Answer


  2. Your xml layout information would probably help with diagnosing problems, Unconstrained views will all appear in top left corner.
    if using constraintLayout, drag views to desired position in design View and set constraints, or use the magic wand.
    Hope that helps ):

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