我只是启动一个小部件,它的xml在AS上的模拟器中显示imageview,但无论我将imageview放在图像不显示的位置。这里是小部件的我的XML布局Android Widget ImageView不显示
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#333"
android:padding="@dimen/widget_margin">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@android:drawable/ic_popup_sync"
android:id="@+id/imageView"
android:layout_alignParentLeft="true"/>
<LinearLayout
android:orientation="horizontal"
android:layout_alignLeft="@+id/imageView"
android:layout_alignRight="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="10">
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4">
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView2" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView3" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView4" />
</LinearLayout>
<TextView
android:text="16:00"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/textView5"
android:textSize="20sp"
android:layout_weight="3" />
<TextView
android:text="14:00"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="12sp"
android:id="@+id/textView6"
android:layout_weight="1" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
app:srcCompat="@android:drawable/ic_media_next"
android:id="@+id/imageView2" />
</RelativeLayout>
即使我把的LinearLayout或RelativeLayout的硬编码DP或其他选项里,甚至与其他项目的图片这是确定内部改变应用程序,没有显示。我只是想知道它没有显示的原因是什么。
对于迟到的回复感到抱歉,我试过这种方式,它仍然没有渲染任何东西。 – CbL