无法将Studio Designer与自定义RelativeLayout派生类

时间:2015-07-24 21:13:04

标签: android android-layout android-studio wear-os

我正在为可穿戴应用添加一些动画,该应用是在从RelativeLayout派生的类中实现的:

package wear.com.watchgui;
public class RippleBackground extends RelativeLayout {...}

如果我尝试在rect_activty_main.xml中使用它,如下所示:

<wear.com.watchgui.RippleBackground xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:orientation="vertical"
    tools:context=".MainActivity" tools:deviceIds="wear_square"
    android:id="@+id/overlayLayout"
    android:clickable="true"
    android:background="#0288d1">
    <TextView ....

然后问题是它无法用Android Studio Designer做任何事情 - 它不可能添加新的小部件,或者拖动并移动现有的小部件等.Android Studio图形界面完全无法使用,就好像GUI被锁定一样不能编辑。

我可以使用文本编辑器界面进行更改,直接编辑布局xml,但是使用图形编辑器界面我无法做任何事情。

有人知道我为什么会遇到这个问题,是否有解决方案?

2 个答案:

答案 0 :(得分:4)

现在已经有issue了一段时间。

似乎已在Android Studio 1.3.0中修复。

你可以找到它here

答案 1 :(得分:0)

尝试这样做 在设计器视图中更改工具栏中的api并将其设置为21  这个问题在Android M Developer Review发布后成为