Create a listview with sides like older email android app - android

I want to create a listview like older gmail app. See the screenshot:
I tried putting an empty view like this:
<TextView
android:id="#+id/color_highlight"
android:layout_width="5dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#ff0000"
android:minHeight="48dp" />
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_toLeftOf="#id/color_highlight"
android:text="Mudit Agarwal"
android:textStyle="bold"
android:textColor="#242424"
android:textIsSelectable="false"
android:textSize="22sp" />
<TextView
android:id="#+id/number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#id/name"
android:layout_below="#id/name"
android:text="9933445566"
android:textColor="#777777"
android:textIsSelectable="false"
android:layout_marginBottom="10dp"
android:textSize="15sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:padding="3dp"
android:src="#drawable/contact" />
but this is not taking full height of the view. Please suggest.

What I changed is
android:layout_alignBottom="#+id/number"
to your color_highlight TextView. and instead of margin, I put padding like below in number TextView.
android:paddingBottom="20dp"
just put following layout code.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/color_highlight"
android:layout_width="5dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_alignBottom="#+id/number"
android:background="#ff0000"
android:minHeight="48dp" />
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_toLeftOf="#id/color_highlight"
android:text="Mudit Agarwal"
android:textColor="#242424"
android:textIsSelectable="false"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="#+id/number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#id/name"
android:layout_below="#id/name"
android:paddingBottom="20dp"
android:text="9933445566"
android:textColor="#777777"
android:textIsSelectable="false"
android:textSize="15sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:padding="3dp"
android:src="#drawable/contact" />
</RelativeLayout>

I'm not sure but you can try putting android:layout_height="0dip" instead of android:layout_height="match_parent".

Related

put overlapping image between horizontal relative layout

Expected Result
Achieved Result
i am able to acheive everything but not able to place image (+ sign) between two layouts as described.
Following is the code i have used. i am not getting idea how should i place ( + sign image ) overlapping between two relative layouts.
I have tried placing imageview between 2 layouts but it takes space between layouts , i want overlapping between 2 layouts.
If anyone has come across such situation before or can help figure out this problem i would be very much grateful to them. thanks in advance.
<LinearLayout
android:id="#+id/line3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/indicator"
android:orientation="horizontal"
android:weightSum="4">
<RelativeLayout
android:id="#+id/line3_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#CCCCCC"
android:padding="#dimen/line3_layout_padding">
<TextView
android:id="#+id/textRent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Rent"
android:textColor="#999999"
android:textSize="#dimen/line3_text1_size" />
<TextView
android:id="#+id/textRentValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/textRent"
android:layout_centerHorizontal="true"
android:text="€30.00"
android:textColor="#999999"
android:textSize="#dimen/line3_text2_size" />
<TextView
android:id="#+id/textRentPerDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textRentValue"
android:layout_centerHorizontal="true"
android:text="Per day"
android:textColor="#999999"
android:textSize="#dimen/line3_text1_size" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/line3_2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#FF3333"
android:gravity="center"
android:padding="#dimen/line3_layout_padding">
<TextView
android:id="#+id/textIns"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Insurance"
android:textColor="#FFFFFF"
android:textSize="#dimen/line3_text1_size" />
<TextView
android:id="#+id/textInsValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/textIns"
android:layout_centerHorizontal="true"
android:text="€4.00"
android:textColor="#FFFFFF"
android:textSize="#dimen/line3_text2_size" />
<TextView
android:id="#+id/textInsPerDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textInsValue"
android:layout_centerHorizontal="true"
android:text="Per day"
android:textColor="#FFFFFF"
android:textSize="#dimen/line3_text1_size" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
android:background="#33CC66"
android:gravity="center"
android:padding="#dimen/line3_layout_padding">
<TextView
android:id="#+id/textEbysComm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Ebys commission"
android:textColor="#FFFFFF"
android:textSize="#dimen/line3_text1_size" />
<TextView
android:id="#+id/textEbysCommValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/textEbysComm"
android:layout_centerHorizontal="true"
android:text="€2.00"
android:textColor="#FFFFFF"
android:textSize="#dimen/line3_text2_size" />
<TextView
android:id="#+id/textEbysCommPerDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textEbysCommValue"
android:layout_centerHorizontal="true"
android:text="Per day"
android:textColor="#FFFFFF"
android:textSize="#dimen/line3_text1_size" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:background="#6666CC"
android:gravity="center"
android:padding="#dimen/line3_layout_padding">
<TextView
android:id="#+id/textTotalCost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Total Cost"
android:textColor="#FFFFFF"
android:textSize="#dimen/line3_text1_size" />
<TextView
android:id="#+id/textTotalCostValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/textTotalCost"
android:layout_centerHorizontal="true"
android:text="€36.00"
android:textColor="#FFFFFF"
android:textSize="#dimen/line3_text2_size" />
<TextView
android:id="#+id/textTotalCostPerDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textTotalCostValue"
android:layout_centerHorizontal="true"
android:text="Per day"
android:textColor="#FFFFFF"
android:textSize="#dimen/line3_text1_size" />
</RelativeLayout>
</LinearLayout>
create three individual layouts as below and place them between RelativeLayouts as
XML for sub type
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="60dp">
<View
android:layout_width="30dp"
android:background="#F00"
android:layout_alignParentLeft="true"
android:layout_height="match_parent"/>
<View
android:layout_width="30dp"
android:background="#0F0"
android:layout_alignParentRight="true"
android:layout_height="match_parent"/>
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="fitCenter"
android:layout_centerInParent="true"
android:src="#android:drawable/ic_dialog_info"/>
</RelativeLayout>

TextView above and exactly centered of the image view works perfectly but in the case high end device the TextView is slightly up. Why?

I make the single_row.xml for the custom adapter which works perfectly on several devices but in the case of HighEnd device , the TextVIew is slightly up from the center. Why ??Please Help..
Image Link to understand the question Clearly
single_row.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageViewSingleRow"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:src="#drawable/one"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:adjustViewBounds="true"
/>
<TextView
android:paddingTop="10dp"
android:paddingBottom="6dp"
android:paddingLeft="5dp"
android:paddingRight="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Title text here"
android:id="#+id/textViewTitle"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignBottom="#+id/imageViewSingleRow"
android:layout_toRightOf="#+id/imageViewSingleRow"
android:layout_toEndOf="#+id/imageViewSingleRow"
android:textSize="18dp"
android:gravity="center_vertical"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textSize="20sp"
android:textStyle="normal"
android:id="#+id/textViewNumbering"
android:layout_alignLeft="#+id/imageViewSingleRow"
android:layout_alignTop="#+id/imageViewSingleRow"
android:layout_alignRight="#+id/imageViewSingleRow"
android:layout_alignBottom="#+id/imageViewSingleRow"
android:gravity="center"
/>
<TextView
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="description"
android:id="#+id/textViewDescription"
android:layout_below="#+id/textViewTitle"
android:layout_centerHorizontal="true" />
<TextView
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="imageLink"
android:id="#+id/textViewImageLink"
android:layout_below="#+id/textViewDescription"
android:layout_alignRight="#+id/textViewDescription"
android:layout_alignEnd="#+id/textViewDescription"
/>
</RelativeLayout>
Finally done for the high end devices too..
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:text="1"
android:padding="26dp"
android:textStyle="bold"
android:id="#+id/textViewNumbering"
android:layout_alignTop="#+id/imageViewSingleRow"
android:layout_alignBottom="#+id/imageViewSingleRow"
android:gravity="center"
/>

Use a transparent button in TableView cells on Android

Please take a look at the following layout. This layout is used in a TableView and is applied in each row. The question is why the button in each tablerow is only clickable in the upper half of the tableviewcell when transparency is applied.
Without transparency the button fills up the correct amount of space.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<ImageButton
android:id="#+id/btnSelect"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="#color/white"
android:contentDescription="Geselecteerde rekening"
android:src="#drawable/checkbox_akkoord_uit" />
<ImageView
android:id="#+id/imgPhoto"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignBottom="#+id/btnSelect"
android:layout_marginLeft="4dp"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/btnSelect"
android:scaleType="fitCenter"
android:src="#drawable/icon_foto" />
<ImageView
android:id="#+id/imgPencil"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignBottom="#+id/btnSelect"
android:layout_marginLeft="4dp"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/btnSelect"
android:src="#drawable/potlood" />
<ImageView
android:id="#+id/ivDrag"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_marginRight="#dimen/activity_horizontal_margin"
android:layout_centerVertical="true"
android:src="#drawable/settings" />
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="8dip"
android:layout_toLeftOf="#+id/ivDrag"
android:layout_toRightOf="#+id/imgPhoto"
android:orientation="vertical" >
<TextView
android:id="#+id/txtDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="Medium Text Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/green"
android:textSize="#dimen/text_size_1" />
<TextView
android:id="#+id/txtProductname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#color/green"
android:textSize="#dimen/text_size_2" />
<TextView
android:id="#+id/txtAccountnumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/green"
android:textSize="#dimen/text_size_3" />
</LinearLayout>
<Button
android:id="#+id/btnModify"
android:background="#android:color/transparent"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_toRightOf="#+id/btnSelect"
android:layout_toLeftOf="#+id/ivDrag" />
Any help is greatly appreciated!
Regards, Raoul
Turns out that the Button needs a minimum height. So the altered XML definition could be:
<Button
android:id="#+id/btnModify"
android:background="#android:color/transparent"
android:minHeight="40dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/btnSelect"
android:layout_toLeftOf="#+id/ivDrag" />
This worked for me!
Regards, Raoul.

Android Textview not showing multiple lines within a list

May be this is a duplicate question,but I am asking it again because the solutions here is not working for me.I have a listview and within the list view I have 2 imageviews and a textview.Refer to the image below:
As you can see I cannot split the textviews into 2 lines and as a result my textview is overlapping with that of the imageview.Here is my code:
uplodefilelist.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/rl_filelist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:paddingBottom="20dp"
android:paddingTop="20dp" >
<ImageView
android:id="#+id/fileimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"
android:src="#drawable/default_avatar" />
<RelativeLayout
android:id="#+id/ll_cntactcont"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/fileimage" >
<TextView
android:id="#+id/tvfilename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Srina Banerjee"
android:textColor="#000000"
android:textStyle="bold"
android:ellipsize="end"
android:maxLines="2"
android:singleLine="false"
/>
<ImageView
android:id="#+id/btnSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="#drawable/settings"
android:textColor="#000000"
android:focusable="false"
android:focusableInTouchMode="false" />
</RelativeLayout>
</RelativeLayout>
I cannot use any html format within the setText() method or I cannot do anything from java file.I have to do it from within the xml file only.I consulted our very own stack overflow and added this lines in my textview.
android:ellipsize="end"
android:maxLines="2"
android:singleLine="false"
But as you can see the image none of them are working.Help.
just add 1 tag in to Textview That
android:layout_toLeftOf="#+id/btnSettings"
So this old one is
<TextView
android:id="#+id/tvfilename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Srina Banerjee"
android:textColor="#000000"
android:textStyle="bold"
android:ellipsize="end"
android:maxLines="2"
android:singleLine="false"/>
Change to :
<TextView
android:id="#+id/tvfilename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Srina Banerjee"
android:textColor="#000000"
android:layout_toLeftOf="#+id/btnSettings"
android:textStyle="bold"
android:ellipsize="end"
android:maxLines="2"
android:singleLine="false"/>
Try this way,hope this will help you to solve your problem.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:gravity="center">
<ImageView
android:id="#+id/fileimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher"
android:adjustViewBounds="true"/>
<LinearLayout
android:id="#+id/ll_cntactcont"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp">
<TextView
android:id="#+id/tvfilename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Srina Banerjee"
android:textColor="#000000"
android:textStyle="bold"
android:ellipsize="end"
android:maxLines="2"/>
</LinearLayout>
<ImageView
android:id="#+id/btnSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher"
android:textColor="#000000"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_marginLeft="5dp"/>
</LinearLayout>
add android:layout_toLeftOf="#+id/btnSettings" in your textview as
<TextView
android:id="#+id/tvfilename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Srina Banerjee"
android:textColor="#000000"
android:textStyle="bold"
android:ellipsize="end"
android:maxLines="2"
android:singleLine="false"
android:layout_toLeftOf="#+id/btnSettings"
/>
And don't forget to clear the project.
Add android:layout_toLeftOf="#+id/btnSettings" in textview and remove its parent relative layout
try this layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/rl_filelist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:paddingBottom="20dp"
android:paddingTop="20dp" >
<ImageView
android:id="#+id/fileimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"
android:src="#drawable/default_avatar" />
<TextView
android:id="#+id/tvfilename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_toLeftOf="#+id/btnSettings"
android:layout_toRightOf="#+id/fileimage"
android:ellipsize="end"
android:maxLines="2"
android:singleLine="false"
android:text="Srina Banerjee"
android:textColor="#000000"
android:textStyle="bold" />
<ImageView
android:id="#+id/btnSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:src="#drawable/settings"
android:textColor="#000000" />
</RelativeLayout>
you just have to add one line to your TextView
android:layout_toLeftOf="#+id/btnSettings"
Try this Code...
<ImageView
android:id="#+id/fileimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"
android:src="#drawable/default_avatar" />
<RelativeLayout
android:id="#+id/ll_cntactcont"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/fileimage" >
<TextView
android:id="#+id/tvfilename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Srina Banerjee "
android:layout_toLeftOf="#+id/btnSettings" <!-- use this for setting textview properly -->
android:textColor="#000000"
android:lines="2" <!-- put this line if you always want to show 2 lines -->
android:textStyle="bold"
android:maxLines="2" <!-- max number of size... used when text is long -->
/>
<ImageView
android:id="#+id/btnSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="#drawable/settings"
android:textColor="#000000"
android:focusable="false"
android:focusableInTouchMode="false" />
</RelativeLayout>
Your textview needs to be a specific width for it to wrap not wrap content. You probably want to do a LinearLayout and not Relative for those 3 views.

ImageView in RelativeView causes crash?

Whenever I create an ImageView in my XML the emulator crashes.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10px"
android:background="#drawable/words_background">
<EditText
android:id="#+id/letters"
android:layout_width="275dp"
android:layout_height="wrap_content"
android:hint="#string/enter_letters" />
<TextView
android:id="#+id/moreText"
android:text="#string/more"
android:layout_alignLeft="#id/letters"
android:layout_below="#id/letters"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="15dp"
android:typeface="normal"
android:paddingLeft="5dp"
android:textStyle="bold" />
<Spinner
android:id="#+id/maxSpinner"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_below="#id/letters"
android:layout_alignRight="#id/letters"
android:visibility="gone" />
<Spinner
android:id="#+id/minSpinner"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_below="#id/maxSpinner"
android:layout_alignRight="#id/letters"
android:visibility="gone" />
<TextView
android:id="#+id/lettersQuestion"
android:typeface="sans"
android:text="#string/question"
android:gravity="right"
android:textSize="20dp"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentRight="true">
</TextView>
<ImageView
android:id="#+id/logo_image" />
</RelativeLayout>
You are missing the + in a few of your id references, and layout_alignRight will accept "true" or "false" only (you are probably looking for layout_ToRightOf)toTherightOf! AND an ImageView needs height and width set to something.
You should definitely look at your LogCat for the exact error,
but your XML should look like this
<RelativeLayout id="#+id/rel_layout">
<Spinner
android:id="#+id/maxSpinner"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/letters"
android:visibility="gone"/>
<Spinner
android:id="#+id/minSpinner"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_below="#+id/maxSpinner"
android:layout_toRightOf="#+id/letters"
android:visibility="gone"/>
<TextView
android:id="#+id/lettersQuestion"
android:typeface="sans"
android:text="#string/question"
android:gravity="right"
android:textSize="20dp"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"/>
<ImageView
android:id="#+id/logo_image"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
</RelativeLayout>

Categories

Resources