Skip to content Skip to sidebar Skip to footer

Incorrect Height Of Remoteviews Notification When Using Linear Layout

I've created a notification using RemoteViews with a custom layout. The layout structure is as below.

Solution 1:

Seems to be working on changing android:layout_height="wrap_content" to android:layout_height="match_parent" for the views within. Somehow missed it earlier, interesting though the behaviour for this combination of values.

Solution 2:

Change your Layout to RelativeLayout and use param android:toLeftOf="@+id/...", android:toRightOf="@+id/..." to align your subView in layout.

<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center_vertical"><ImageViewandroid:id="@+id/image1"android:layout_width="wrap_content"android:layout_height="match_parent"android:layout_alignParentLeft="true"android:src="@drawable/ic_launcher" /><ImageViewandroid:id="@+id/image2"android:layout_width="wrap_content"android:layout_height="match_parent"android:layout_toRightOf="@+id/image1"android:src="@drawable/ic_launcher" /></RelativeLayout>

Post a Comment for "Incorrect Height Of Remoteviews Notification When Using Linear Layout"