简体   繁体   English

我在模拟器上运行它时,我的应用程序样式会发生变化

[英]My application style changes when i run it on emulator

i'm kind of knew in application developting. 我在应用程序开发方面有点了解。 I'm having trouble When i'm styling the application layout. 当我在设计应用程序布局时,我遇到了麻烦。 it looks good. 看起来不错。 good as the way i want the appliaction to be. 好像我想要的应用方式。 but when i'm trying to run it the all application messedup all jumps to the left top of the app, anyone knows why? 但是当我试图运行它时,所有应用程序messedup都会跳转到应用程序的左上角,任何人都知道为什么? IMG 1

IMG 2

This is the layout xml code: 这是布局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>

You should check out RelativeLayout. 你应该看看RelativeLayout。 I recommend using RelativeLayout in your case. 我推荐在你的情况下使用RelativeLayout。 https://developer.android.com/guide/topics/ui/layout/relative.html You can find other tutorials as well. https://developer.android.com/guide/topics/ui/layout/relative.html您也可以找到其他教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase实时数据库错误,尝试在模拟器中运行时我的应用程序已停止 - Firebase real time database error ,My application is stopped when I am trying to run in emulator 运行项目时,我的应用程序未在模拟器上显示 - My app doesn't show on emulator, when I run the project 单击运行时,Android Studio 模拟器未运行我的应用程序 - Android studio emulator is not running my app when I click run 运行应用程序时Weblogic中出现异常? - exception in Weblogic when i run my application? 运行应用程序时Java代码中的更改未消失 - Changes in java code not refelecting when i run the application 当我运行我的应用程序时出现未知错误 - unknown error when i run my application 运行项目时,未反映对Eclipse中的类所做的更改 - Changes to my classes in Eclipse are not reflected when I run the project 运行模拟器时菜单不显示 - Menu not showing up when i run emulator 当我在Android Studio上运行我的应用程序时,模拟器会启动,但它表示测试应用程序已崩溃 - When I run my app on Android Studio, emulator starts but it says that the test app crashed 当我尝试在 AVD 模拟器上运行我的应用程序时“[AppName] 停止工作” - "[AppName] stopped working" when I try to run my app on an AVD emulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM