I’m facing a strange problem and I can’t figure out why I systematically get an unexpected stop of my application when I try to inflate the following XML file in the onCreateView of my class which extends the Fragment class :
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/fond_application_horizontal">
<Button
android:id="@+id/ZoomPlusY"
android:layout_height="140dip"
android:layout_width="40dip"
android:text="Y+">
</Button>
<Button
android:id="@+id/ZoomMoinsY"
android:layout_height="140dip"
android:layout_width="40dip"
android:layout_below="@id/ZoomPlusY"
android:text="Y-">
</Button>
<Button
android:id="@+id/ZoomOptimum"
android.layout.width="70dip"
android.layout.height="40dip"
android:layout_below="@id/ZoomMoinsY"
android:text="Opt">
</Button>
</RelativeLayout>
If I suppress the third button, the XML file is perfectly inflated and the application doesn’t crash.
Any idea?
Thanks in advance for the time you will spend trying to help me.
You should probably include your logcat traceback, but immediately at looking at your layout I see at least one problem:
Those property names should be
android:layout_heightandandroid:layout_width.Also,
android:orientationis meaningless on aRelativeLayout.