For me, the problem was that I was setting a specific height for the root layout, in the custom notification view xml file.
As soon as I changed:
android:layout_height=”@dimen/notification_expanded”
to
android:layout_height=”match_parent”
in the root layout of notification view, the problem was solved.
Also take a look at this example to see a simple example of using custom layout for notifications.