Android脏版面 [英] Android Smudged layout
问题描述
我从未见过这样的事情,我的布局只是在设备上(运行Android 4.4.2的Infinix Zero X506运行在设备上)弄脏了,但是在仿真器上它显示得很好,我无法找出原因,我在这里或Google上都没有看到类似的问题.我正在使用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
Below is my layout 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
推荐答案
This is confirmed fixed with Android Studio 2.2 Preview 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
请对该问题进行投票,该问题将在官方错误跟踪器条目中解决这里
Please vote for the issue to be fixed on the official bug tracker entry here
这篇关于Android脏版面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!