【问题标题】:Android Widget adding buttonsAndroid Widget 添加按钮
【发布时间】:2018-01-23 20:49:34
【问题描述】:

我正在尝试向我的(正在工作的)小部件添加按钮,但它不断中毒(小部件图像无法加载)。

这是我的布局....有什么问题?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/widget">

    <TextView
        android:id="@+id/text"
        android:background="@android:color/holo_blue_bright"
        android:textColor="@android:color/white"
        android:textAppearance="@android:style/TextAppearance.Medium"
        android:layout_weight="1"
        android:layout_width="0dp"
        android:layout_height="wrap_content" />

    <ImageButtonButton
        android:id="@+id/snooze"
        android:layout_weight="1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_snooze_24dp">
    </ImageButtonButton>

    <ImageButtonButton
        android:id="@+id/add"
        android:layout_weight="1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_add_24dp">
    </ImageButtonButton>

</LinearLayout>

【问题讨论】:

    标签: android xml android-layout android-widget


    【解决方案1】:

    不是ImageButtonButton,应该是ImageButton

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-12
      • 1970-01-01
      • 1970-01-01
      • 2015-06-26
      相关资源
      最近更新 更多