0

I'm trying to stretch vertical line in calendar_header.png horizontally as background in xml style:

<style name="CaldroidCalendarViewLayout">
    <item name="android:background">@drawable/calendar_header</item>
</style>

But it changes height of the control by height of the background. How can I solve that? I just want to fill the actual size of the control with stretched background. (It acts like background image is a part of the content - not like it's just a background.)

Dmitry
  • 14,306
  • 23
  • 105
  • 189

1 Answers1

0

The following answer helped me: https://stackoverflow.com/a/19405297/865475

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
    android:src="@drawable/activation_popup"
    android:scaleType="fitXY"
    android:layout_width="0dp"
    android:layout_height="0dp"
    android:layout_alignTop="@+id/activation_layout"
    android:layout_alignBottom="@id/activation_layout"
    android:layout_alignLeft="@id/activation_layout"
    android:layout_alignRight="@id/activation_layout"
    android:contentDescription="@string/act_code_label" />
<LinearLayout
    android:id="@id/activation_layout"
    android:clipToPadding="true"
    android:padding="25dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical" >
    <!-- LinearLayout wraps a bunch of smallish views here -->
</LinearLayout>
</RelativeLayout>
Dmitry
  • 14,306
  • 23
  • 105
  • 189