Android 如何在远程视图中添加应用程序图标
我试图在android中显示自定义通知,我正在接收通知,缺少的部分,我需要在通知的左侧显示应用程序图标,这是可能的 自定义通知.xmlAndroid 如何在远程视图中添加应用程序图标,android,android-layout,android-intent,Android,Android Layout,Android Intent,我试图在android中显示自定义通知,我正在接收通知,缺少的部分,我需要在通知的左侧显示应用程序图标,这是可能的 自定义通知.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout" android:layout_width="fill_parent" android:background="@drawable/layou
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:layout_width="fill_parent"
android:background="@drawable/layout_bg"
android:layout_height="fill_parent"
android:padding="10dp" >
<ImageView android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_marginRight="10dp" />
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/image"
android:textColor="@color/white"
style="Custom Notification Title" />
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/image"
android:layout_below="@id/title"
android:textColor="@color/white"
style="Custom Notification Text" />
<TextView android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/image"
android:layout_below="@id/text"
android:textColor="@color/white"
style="Custom Notification Text2" />
</RelativeLayout>
在布局中使用android:drawableLeft属性 android:drawableLeft 可在文本左侧绘制的图形 可以是对其他资源的引用,格式为 “@[+][package:]type:name”或表单中的主题属性 “?[package:][type:]name” 可以是颜色值,其形式为“#rgb”、“#argb”、“#rrggbb”或 “#AARGGBB” 这对应于全局属性资源符号drawableLeft
android文档打开。我的徽标有问题。我使用了ic_launcher.png作为它的座位。