活动在仿真时显示不正确

时间:2017-04-11 23:01:59

标签: android

我是Android新手,但每当我尝试查看我的活动时,它都显示不正确。

当我在设计视图中正确定位所有内容时,模拟设备上的所有内容都在左侧。

Sorry can't embed yet

这是xml代码

 <?xml version="1.0" encoding="utf-8"?>
    <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"
    tools:context="com.example.chemdawg.myapplication.MainActivity">

    <Button
        android:id="@+id/bio"
        android:layout_width="133dp"
        android:layout_height="47dp"
        android:text="Biography"
        tools:layout_editor_absoluteX="7dp"
        tools:layout_editor_absoluteY="533dp" />

    <Button
        android:id="@+id/pro"
        android:layout_width="133dp"
        android:layout_height="47dp"
        android:text="Projects"
        tools:layout_editor_absoluteX="139dp"
        tools:layout_editor_absoluteY="533dp" />

    <Button
        android:id="@+id/gam"
        android:layout_width="133dp"
        android:layout_height="47dp"
        android:text="Games"
        tools:layout_editor_absoluteX="272dp"
        tools:layout_editor_absoluteY="533dp" />

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="222dp"
        android:layout_height="199dp"
        app:srcCompat="@mipmap/ic_launcher"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintBottom_toTopOf="@+id/pro"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.395"
        app:layout_constraintHorizontal_bias="0.497" />

    </android.support.constraint.ConstraintLayout>

0 个答案:

没有答案