【问题标题】:My application style changes when i run it on emulator当我在模拟器上运行它时,我的应用程序样式发生了变化
【发布时间】:2017-05-16 20:04:58
【问题描述】:

我有点了解应用程序开发。 我在设计应用程序布局时遇到了麻烦。这看起来不错的样子。就像我希望应用程序那样好。 但是当我尝试运行它时,所有应用程序都搞砸了,都会跳到应用程序的左上方,有人知道为什么吗?

这是布局xml代码:

    <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="tech.XXX.LoginA">

    <EditText
        android:id="@+id/tName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:hint="Tech name"
        android:inputType="textPersonName"
        tools:layout_editor_absoluteX="49dp"
        tools:layout_editor_absoluteY="49dp" />

    <Button
        android:id="@+id/bLogin"
        android:layout_width="321dp"
        android:layout_height="98dp"
        android:elevation="0dp"
        android:text="Login"
        tools:layout_editor_absoluteX="32dp"
        tools:layout_editor_absoluteY="151dp" />
</android.support.constraint.ConstraintLayout>

【问题讨论】:

    标签: java android xml android-layout android-studio


    【解决方案1】:

    你应该看看RelativeLayout。我建议在您的情况下使用 RelativeLayout。 https://developer.android.com/guide/topics/ui/layout/relative.html你也可以找到其他教程。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多