view-hierarchy

First view above / overlapping second in LinearLayout

扶醉桌前 提交于 2019-11-30 18:34:37
Is it possible to show the first view in a LinearLayout overlapping the second? I would like to layout my views like so: <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_alignParentRight="true" > <TextView android:id="@+id/firstTextView" android:layout_width="wrap_content" android:layout_height="wrapContent" /> <TextView android:id="@+id/secondTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> But I need my first view from the layout, firstTextView, to be

First view above / overlapping second in LinearLayout

我的梦境 提交于 2019-11-30 02:45:13
问题 Is it possible to show the first view in a LinearLayout overlapping the second? I would like to layout my views like so: <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_alignParentRight="true" > <TextView android:id="@+id/firstTextView" android:layout_width="wrap_content" android:layout_height="wrapContent" /> <TextView android:id="@+id/secondTextView" android:layout_width="wrap_content" android:layout

ConstraintLayout views in top left corner

≯℡__Kan透↙ 提交于 2019-11-25 23:04:31
问题 Every time I create views like Button and TextView in ConstraintLayout , they all get stuck at the top corner instead of where I placed them. I tried to create new activities and change the emulator, but the result is still the same. This is a screenshot of what\'s happening: What may be the issue? 回答1: As stated in Constraint Layout guides: If a view has no constraints when you run your layout on a device, it is drawn at position [0,0] (the top-left corner). You must add at least one