android / codelab-constraint-layout

Constraint Layout Codelab
https://codelabs.developers.google.com/codelabs/constraint-layout/
Apache License 2.0
470 stars 242 forks source link

Settings text view jumps to top #2

Closed iamtodor closed 8 years ago

iamtodor commented 8 years ago

I have an issue with activity_main_done.xml. The lint says that this text view

<TextView
        android:text="@string/settings"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_editor_absoluteX="16dp"
        app:layout_editor_absoluteY="238dp"
        android:id="@+id/settingsLabel"
        android:labelFor="@+id/settings"
        app:layout_constraintLeft_creator="1"
        app:layout_constraintBaseline_creator="1"
        tools:layout_editor_absoluteX="16dp"
        tools:layout_editor_absoluteY="241dp"
        app:layout_constraintLeft_toLeftOf="@+id/activity_main_done"
        android:layout_marginStart="16dp"
        tools:layout_constraintLeft_creator="0" />

This view is not constrained vertically: at runtime it will jump to the left unless you add a vertical constraint. And here are some behaviour this layout at preview device and at geny motion virtual device screenshot from 2016-05-20 11-17-41

Take a look at Settings, where it places at the preview and where I actually get it at the virtual device. If you need more specific information - feel free to contact me.

iamtodor commented 8 years ago

I don't want to produce one more issue, so I just leave my problem here.

Your material provides left-right and top-bottom buttons, quote https://codelabs.developers.google.com/codelabs/constraint-layout/index.html#8 : 1.First, drag a TextView from the palette and place it below the settings text view. 2.Use the 51aa1ac52c475f63 action to expand the view horizontally to match guidelines. 3.Use the b371d9cf536b11bf action to expand vertically to fill available vertical space.

But my android studio hasn't it. screenshot from 2016-05-20 12-46-45 screenshot from 2016-05-20 12-47-08

Is there something wrong with me?

nageshs commented 8 years ago

Thankyou for reporting the issue. This should be fixed with https://github.com/googlecodelabs/constraint-layout/commit/64b7345d0165e12bb7acfc55eebf093f489e9a29

nageshs commented 8 years ago

@Iamtodor For the second issue that you mentioned. Is the textview being selected in the UI Builder? Can you please try this and let me know how it goes? Maybe I should add a sentence about ensuring that the textView is selected?

iamtodor commented 8 years ago

Somehow now it works fine, don't know where was the problem

nageshs commented 8 years ago

please open a new issue or feel free to create one on b.android.com if it resurfaces.