I have got two LinearLayouts. I the first LinearLayout I set ImageButton. How fill imagebutton edges equally with the LinearLayout and next how fill background image edges equally with ImageButton
??
For example. If my LinearLayout have dimension height:20 dp width:20dp, then imagebutton should have dimension dimension height:20 dp width:20dp and background image should have dimension dimension height:20 dp width:20dp.
My code:
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingRight="@dimen/activity_horizontal_margin"
android:showDividers="none" >
<LinearLayout
android:id="@+id/zdj"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_weight="0.25"
android:orientation="vertical"
>
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:scaleType="fitCenter"
android:src="@drawable/wawel" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_weight="0.75"
android:background="@drawable/tlo12"
android:orientation="horizontal"
android:paddingLeft="@dimen/activity_horizontal_margin">
<TextView
android:id="@+id/textViewNazwaObiektu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.63"
android:textSize="20sp" />
</LinearLayout>
</TableRow>