Android的污迹布局

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

下面是我的布局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> 

如果有帮助的话,微调器中的条目是由定制适配器提供的

Android Studio 2.2 Preview 4确认了这一点

所以你不再需要回复原来的答案解释插件版本2.1.0。

原始答案:

这是gradle插件的alpha版本的问题。 如果您将插件版本还原到2.1.0,则可以继续使用Android Studio 2.2,如下所示:

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

在你的根项目build.gradle

请在此处投票select正式的bug跟踪器条目

只要改变你build.gradle文件。

 classpath 'com.android.tools.build:gradle:2.2.0-alpha1' 

 classpath 'com.android.tools.build:gradle:2.1.2'