【发布时间】:2019-03-12 02:42:30
【问题描述】:
我定义了一个约束布局,里面有一个按钮。问题是我似乎无法移动按钮,因为它固定在屏幕的左上角。
有什么帮助吗?
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
tools:context=".MainActivity">
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
【问题讨论】:
-
您想以编程方式移动它吗?还是从设计视图?
-
从设计的角度来看,它只是从设计的角度不起作用,令人沮丧。
-
你还没有连接约束..连接约束并拖动水平biaz放置按钮。
-
尝试为按钮添加约束
-
所有这些功能都不起作用。
标签: java android android-studio mobile