Android 污迹布局 [英] Android Smudged layout

查看:26
本文介绍了Android 污迹布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从未见过这样的事情,我的布局在我的设备上被弄脏了(运行 Android 4.4.2 的 Infinix Zero X506)但是在模拟器上它显示得很好,我无法找出原因,我没有在这里或在谷歌上看到类似的问题.我正在使用 Android Studio 2.2 预览版 1下面是一张图片

I've never seen a thing like this, my layout is just smudged on my device (Infinix Zero X506 running Android 4.4.2) however on an emulator it displays just fine, I can't figure out the cause and I haven't seen a similar question here or on Google. I am using Android Studio 2.2 Preview 1 Below is an image

下面是我的布局xml

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_margin="@dimen/activity_horizontal_margin">
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    <TextView
        android:text="@string/title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView"
        android:textStyle="bold"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textCapSentences"
        android:hint="@string/enter_title"
        android:ems="10"
        android:maxLines="2"
        android:id="@+id/edName" />

    <TextView
        android:text="@string/to_do_details"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView2"
        android:textStyle="bold"
        android:layout_marginTop="10dp"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textMultiLine|textCapSentences"
        android:ems="10"
        android:hint="@string/enter_to_do_details"
        android:id="@+id/edDetails" />

    <TextView
        android:text="@string/select_priority"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView3"
        android:textStyle="bold"
        android:layout_marginTop="10dp"/>

    <Spinner
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/spPriority"
        />
    <TextView
        android:text="@string/set_time"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView6"
        android:textStyle="bold"
        android:layout_marginTop="10dp"/>
    <Button
        android:background="@color/colorAccent"
        android:textStyle="bold"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:id="@+id/btDate"
        />
    <TextView
        android:text="@string/set_date"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView4"
        android:textStyle="bold"
        android:layout_marginTop="10dp"/>

    <Button
        android:background="@color/colorAccent"
        android:textStyle="bold"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:id="@+id/btTime"
        />

    <Button
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/button"
        android:text="@string/save"
        android:gravity="center"
        android:layout_gravity="center"/>
 </LinearLayout>
</ScrollView>

如果有帮助,微调器中的条目来自自定义适配器

The entries in the spinner are feed from a custom adapter if that helps

推荐答案

此问题已通过 Android Studio 2.2 预览版 4

因此您不再需要按照原始答案的解释恢复到插件版本 2.1.0.

So you no longer need to revert to plugin version 2.1.0 as the original answer explained.

原答案:

这是 gradle 插件 alpha 版本的问题.如果您将插件版本恢复为 2.1.0,则可以继续使用 Android Studio 2.2,如下所示:

This is a problem with the alpha version of the gradle plugin. You can continue using Android Studio 2.2 if you revert the plugin version to 2.1.0, like so:

buildscript {

    ...

    dependencies {
        // other entries here
        classpath 'com.android.tools.build:gradle:2.1.0'
    }

    ...

}

在你的根项目 build.gradle

请投票支持要在 官方错误跟踪器条目上修复的问题这里

这篇关于Android 污迹布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆