Android主屏幕小部件因EditText失败
每当我将Android主屏幕小部件因EditText失败,android,Android,每当我将EditText小部件添加到我的主屏幕小部件的布局中时(混淆了术语widget在Android词典中被使用了两次:-/),我就会收到“加载小部件问题”错误框 这是我正在尝试的布局;如果删除EditText,它可以工作 <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http:
EditText
小部件添加到我的主屏幕小部件的布局中时(混淆了术语widget
在Android词典中被使用了两次:-/),我就会收到“加载小部件问题”错误框
这是我正在尝试的布局;如果删除EditText,
它可以工作
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<Button
android:id="@+id/button_generate"
android:layout_width="54px"
android:layout_height="54px"
android:text="Generate"
android:textSize="10sp"
android:gravity="center"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/edittext_key">
</Button>
<TextView
android:id="@+id/textview_hash"
android:layout_width="75px"
android:layout_height="45px"
android:text="Password"
android:textSize="11sp"
android:gravity="left"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/edittext_key">
</TextView>
<EditText
android:id="@+id/edittext_data2"
android:layout_width="200px"
android:layout_height="50px"
android:textSize="12sp"
android:layout_marginTop="20px"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true">
</EditText>
</RelativeLayout>
现在,Google Search home screen小部件有一个
EditText,
,因此它的实现显然是合法的。有没有想过为什么这不起作用?小部件使用RemoteView,它只支持一定数量的UI元素。不包括编辑文本。Android显示哪些是受支持的
谷歌搜索主屏幕小部件实际上使用了文本视图。()小部件使用RemoteView,它只支持一定数量的UI元素。不包括编辑文本。Android显示哪些是受支持的
谷歌搜索主屏幕小部件实际上使用了文本视图。()“谷歌搜索主屏幕小部件有一个EditText”不,它没有——当你点击它时,它会弹出一个EditText。此外,这不是一个应用程序小部件,而是主屏幕的一个功能。“谷歌搜索主屏幕小部件有一个EditText”不,它没有——当你点击它时,它会弹出一个EditText。此外,好吧,这不是一个应用程序小部件,而是主屏幕的一个功能。谢谢!这是一个很棒的答案。谢谢!这是一个令人敬畏的答案。