Put Image View above Button - Android - java

I have some XML that looks like this
<!--
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/divider"
android:layout_centerHorizontal="true"
android:background="#ffffff"
android:minWidth="2dp"
android:layout_below="#+id/emailField" />
-->
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:id="#+id/Btn1"
android:background="#907F0106"
android:layout_below="#+id/emailField"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textColor="#ffffff" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
android:id="#+id/Btn2"
android:background="#907F0106"
android:textColor="#ffffff"
android:layout_below="#+id/emailField"
android:layout_alignRight="#+id/emailField"
android:layout_alignEnd="#+id/emailField" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/divider"
android:layout_centerHorizontal="true"
android:background="#ffffff"
android:minWidth="2dp"
android:layout_below="#+id/emailField" />
I have tried it above and below but it always looks like it is partly hidden behind the buttons, as seen below
But I want a full white line going down, not one that is partly hidden behind?

Try using view instead of ImageView
<View
android:id="#+id/view"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_below="#+id/relativeLayout"
android:background="#color/yourDesiredColor" />

Related

EditText boxes look differently onFocus event

Hi I have a couple of EditText boxes in a GridLayout. However, the code for the EditText is exactly the same. But they look different onFocus event. Any idea why this is occurring?
The texboxes after each one of them were selected:
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:alignmentMode="alignBounds"
android:columnCount="3"
android:columnOrderPreserved="false"
android:useDefaultMargins="true">
<TextView
android:id="#+id/tvDisinfectionContact"
style="#style/formsubsubheader"
android:layout_width="250dp"
android:layout_columnSpan="3"
android:layout_gravity="fill_horizontal"
android:paddingTop="10dp"
android:text="#string/disinfection_contact" />
<TextView
android:layout_width="300dp"
android:layout_columnSpan="1"
android:gravity="start"
android:visibility="gone" />
<TextView
android:id="#+id/tvPpmUnit"
style="#style/fieldlabel"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_columnSpan="1"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="#string/unit_ppm" />
<TextView
android:id="#+id/tvMinutesUnits"
style="#style/fieldlabel"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_columnSpan="1"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="#string/unit_mins" />
<TextView
android:id="#+id/tvLvlCheAdd"
style="#style/fieldlabel"
android:layout_width="250dp"
android:layout_columnSpan="1"
android:gravity="start"
android:labelFor="#+id/etLvlCheAddPpm"
android:paddingTop="12dp"
android:text="#string/lvl_cheaddition" />
<EditText
android:id="#+id/etLvlCheAddPpm"
android:width="100dp"
android:layout_columnSpan="1"
android:layout_gravity="center_horizontal"
android:ems="16"
android:gravity="center_horizontal"
android:inputType="numberDecimal"
android:maxLength="50"/>
<EditText
android:id="#+id/etLvlCheAddMinutes"
android:layout_columnSpan="1"
android:layout_gravity="center_horizontal"
android:width="100dp"
android:ems="16"
android:gravity="center_horizontal"
android:inputType="numberDecimal"
android:maxLength="50" />
<TextView
android:id="#+id/tvLvlFlushADD"
style="#style/fieldlabel"
android:layout_width="250dp"
android:layout_columnSpan="1"
android:gravity="start"
android:labelFor="#+id/etLvlFlushAddPpm"
android:paddingTop="12dp"
android:text="#string/lvl_flushddition" />
<EditText
android:id="#+id/etLvlFlushAddPpm"
android:width="100dp"
android:layout_columnSpan="1"
android:layout_gravity="center_horizontal"
android:ems="16"
android:gravity="center_horizontal"
android:inputType="numberDecimal"
android:maxLength="50" />
<EditText
android:id="#+id/etLvlFlushMinutes"
android:layout_columnSpan="1"
android:layout_gravity="center_horizontal"
android:width="100dp"
android:ems="16"
android:gravity="center_horizontal"
android:inputType="numberDecimal"
android:maxLength="50" />
</GridLayout>
On Android O there has been some Input and Navigation Changes . You won't see the changes in the View on different android versions. You can check if your app is running on O, and if so call setDefaultFocusHighlightEnabled(false) on the EditText view.
This sets whether this View should use a default focus highlight when it gets focused but doesn't have R.attr.state_focused defined in its background.

How to fill a full line in a vertical LinearLayout

This is my first app so sorry I know its not that good. My english neither.
I got a problem with my xml design: I want 2 Buttons and 2 TextViews in one line and to fill the whole line. At the moment it looks like that:
but it gets even worse:
My code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="-" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<Button
android:id="#+id/button11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="+" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="-" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<Button
android:id="#+id/button12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="+" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="#+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="-" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<Button
android:id="#+id/button13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="+" />
</LinearLayout>
<!--
skipping additional rows of identical structure
-->
</LinearLayout>
The problem is that you use wrap_content on the children of the linear layout. there are 2 solutions to your problem one is to use match parent on the text views and add gravity centre to them like this:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="#+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="-" />
<TextView
android:id="#+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="centre"
android:text="TextView" />
<TextView
android:id="#+id/textView13"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="centre"
android:text="TextView" />
<Button
android:id="#+id/button13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="+" />
</LinearLayout>
And another solution is to use a constraint layout with allows you to spread the child views using chains.
If I understood correctly, you should try for each of your LinearLayout :
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="4" // number of sub items
>
<Button
android:id="#+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="-" />
<TextView
android:id="#+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TextView" />
<TextView
android:id="#+id/textView11"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TextView" />
<Button
android:id="#+id/button11"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="+" />
Also, you should take a look at RecyclerViews and create your own adapter and rows. It will be much easier to deal with.

App design problems: scroll and amount problems

I am new to StackOverflow and I am not totaly shure if this is right but I want to make an android app for my fathers company, He is the owner of a Bed&Breakfirst and he wants an app to keep track of consumptions. I planed an interface of the product list where all consumptions can be chosen like this:
http://imgur.com/cwY4YtK
Now the problem is that we need to be able to add and remove products. otherwise i whold have done it like this:
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:id="#+id/widget46"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<Button
android:id="#+id/widget47"
android:layout_width="48dp"
android:layout_height="wrap_content"
android:text="Button"
android:layout_x="267dp"
android:layout_y="2dp" />
<Button
android:id="#+id/widget52"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_x="266dp"
android:layout_y="43dp" />
<TextView
android:id="#+id/widget53"
android:layout_width="253dp"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_x="9dp"
android:layout_y="10dp" />
<TextView
android:id="#+id/widget54"
android:layout_width="251dp"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_x="8dp"
android:layout_y="50dp" />
<Button
android:id="#+id/widget55"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_x="267dp"
android:layout_y="85dp" />
<Button
android:id="#+id/widget56"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_x="267dp"
android:layout_y="128dp" />
<TextView
android:id="#+id/widget57"
android:layout_width="259dp"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_x="2dp"
android:layout_y="92dp" />
<TextView
android:id="#+id/widget58"
android:layout_width="256dp"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_x="6dp"
android:layout_y="136dp" />
</AbsoluteLayout>
But that can only be done if you know the ammount of products that you have. But wee need to add and remove products (Editing isen't neccesary.).
Also if we add to many products to fit on the screen I want to make a scroll option that can scroll trough all products like that.
Is there any way to do those twoo things or is this immpossibile?
A1:
Use TableLayout (or GridLayout etc) and page change buttons.
(This is easier.)
In this pattern, table (in layout) has fixed count rows.
Set OnClickListener to next / prev button to update each cell (text views) text.
(ex: page1: product name of row 0 to 4 is shown, page2: row 5 to 9 is shown)
OnClickListeners of each buttons next to cell text views needs to be modified too.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text_01"
android:layout_width="#dimen/text_view_width"
android:layout_height="wrap_content"
android:text="cell 01" />
<Button
android:id="#+id/button_01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text_02"
android:layout_width="#dimen/text_view_width"
android:layout_height="wrap_content"
android:text="cell 02" />
<Button
android:id="#+id/button_02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text_03"
android:layout_width="#dimen/text_view_width"
android:layout_height="wrap_content"
android:text="cell 03" />
<Button
android:id="#+id/button_03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text_04"
android:layout_width="#dimen/text_view_width"
android:layout_height="wrap_content"
android:text="cell 04" />
<Button
android:id="#+id/button_04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text_05"
android:layout_width="#dimen/text_view_width"
android:layout_height="wrap_content"
android:text="cell 05" />
<Button
android:id="#+id/button_05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</TableRow>
</TableLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Prev" />
<TextView
android:id="#+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center" />
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next" />
</LinearLayout>
</LinearLayout>
A2:
Use ScrollView that contains TableLayout (or GridLayout etc.) inside.
In this pattern, table (in layout) row count must be changed to suit your data count.
(Create/remove TableRows in your code and add/remove them from table)
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text_01"
android:layout_width="#dimen/text_view_width"
android:layout_height="wrap_content"
android:text="cell 01" />
<Button
android:id="#+id/button_01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text_02"
android:layout_width="#dimen/text_view_width"
android:layout_height="wrap_content"
android:text="cell 02" />
<Button
android:id="#+id/button_02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</TableRow>
</TableLayout>
</ScrollView>
for A1 and A2:
res/values/dimens.xml
<resources>
<dimen name="text_view_width">250dp</dimen>
</resources>
You might want to use android listview or gridview, whatever suits you. Here is a good tutorial on how to use a list view.

Another linear layout with a button not appearing

i made another linear layout beside the first one by your help, but now after trying to add a new button in the left the button is not appearing even though i made wrap_content as i learned but still it's not appearing while the buttons in the first linearlayout are working perfectly i hope you can help and thanks
this is the main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="right"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="اضغط على من تريد معرفة المزيد عنه"
android:padding="10dp"
/>
<Button
android:id="#+id/buttontype1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />
<Button
android:id="#+id/button1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />
<Button
android:id="#+id/button2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stop"/>
<Button
android:id="#+id/button3"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />
<Button
android:id="#+id/button4"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Stop" />
<Button
android:id="#+id/button5"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />
<Button
android:id="#+id/button6"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stop"/>
<Button
android:id="#+id/button7"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />
<Button
android:id="#+id/button8"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stop"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="vertical" >
<Button
android:id="#+id/buttonkk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:text="HII"/>
</LinearLayout>
</LinearLayout>
Put everything inside a ScrollView
Try to set all your button with value android:layout_weight="1"
It allows you to achieve proportional distribution of elements within a LinearLayout.
Read that : http://ugiagonzalez.com/2012/01/19/android-linearlayout-distribution-explained-weight-and-sizes/

Exception raised during rendering: Circular dependencies cannot exist in RelativeLayout Exception details are logged in Window > Show View > Error Log

suddenly eclipse started to give that error.
"Exception raised during rendering: Circular dependencies cannot exist in RelativeLayout
Exception details are logged in Window > Show View > Error Log"
This is my xml file.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/relative_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
tools:context=".Generate" >
<View
android:id="#+id/view2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/generatetv1"
android:layout_alignTop="#+id/generatetv1"
android:layout_centerHorizontal="true"
android:background="#90000000" />
<View
android:id="#+id/view1"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_alignBottom="#+id/generate_dukkan"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/generate_direnisci_adi"
android:background="#drawable/extension" />
<Button
android:id="#+id/generatebtn3"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="20dp"
android:background="#drawable/button"
android:text="Buradan Git" />
<Button
android:id="#+id/generatebtn2"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_above="#+id/generatebtn1"
android:layout_marginBottom="4dp"
android:background="#drawable/button"
android:text="Button2" />
<Button
android:id="#+id/generatebtn1"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_above="#+id/generatebtn3"
android:layout_marginBottom="16dp"
android:background="#drawable/button"
android:text="generate_dukkan" />
<TextView
android:id="#+id/generate_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignRight="#+id/generatetv1"
android:text="DigitalClock"
android:textColor="#FFFFFF"
android:textSize="20dp" />
<TextView
android:id="#+id/generatetv1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/generatebtn2"
android:layout_below="#+id/generate_puan"
android:textColor="#FFFFFF"
android:layout_marginTop="80dp"
android:text="#string/hello_world"
android:textSize="20dp" />
<TextView
android:id="#+id/generate_puantext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/generate_seviye"
android:layout_alignBottom="#+id/generate_seviye"
android:layout_alignLeft="#+id/generate_time"
android:text="Puan "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#FFFFFF" />
<TextView
android:id="#+id/generate_puan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/generate_seviye"
android:layout_alignBottom="#+id/generate_seviye"
android:layout_alignRight="#+id/generate_time"
android:layout_toRightOf="#+id/generate_puantext"
android:background="#242424"
android:gravity="right"
android:text="200"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#FFFFFF" />
<TextView
android:id="#+id/generate_seviye"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/generatetv1"
android:layout_alignRight="#+id/destekimg"
android:layout_marginBottom="2dp"
android:layout_toRightOf="#+id/generate_seviyetext"
android:background="#242424"
android:gravity="right"
android:text="0"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#FFFFFF" />
<TextView
android:id="#+id/generate_direnisci_adi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/generate_seviye"
android:layout_alignLeft="#+id/generate_seviye"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/generate_time"
android:text="Direnisci Adi"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#FFFFFF" />
<ImageView
android:id="#+id/maskeimg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/view1"
android:layout_alignLeft="#+id/generate_seviye"
android:layout_alignTop="#+id/eldivenimg"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:adjustViewBounds="true"
android:background="#drawable/text_field"
android:src="#android:drawable/spinner_background" />
<ImageView
android:id="#+id/eldivenimg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/view1"
android:layout_alignTop="#+id/generate_dukkan"
android:layout_marginRight="5dp"
android:layout_toRightOf="#+id/maskeimg"
android:adjustViewBounds="true"
android:background="#drawable/text_field"
android:src="#android:drawable/spinner_background" />
<ImageView
android:id="#+id/destekimg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/view1"
android:layout_alignTop="#+id/eldivenimg"
android:layout_toRightOf="#+id/eldivenimg"
android:adjustViewBounds="true"
android:background="#drawable/text_field"
android:src="#android:drawable/spinner_background" />
<TextView
android:id="#+id/generate_seviyetext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/view1"
android:layout_below="#+id/generate_time"
android:layout_marginTop="10dp"
android:text="Sevİye "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#FFFFFF" />
<Button
android:id="#+id/generate_dukkan"
style="?android:attr/buttonStyleSmall"
android:layout_width="80dp"
android:layout_height="30dp"
android:layout_alignRight="#+id/generate_time"
android:layout_below="#+id/generate_puan"
android:background="#drawable/dukkan_img"
android:layout_marginTop="5dp"
android:scaleType="centerCrop" />
what can I do to fix this?
The problem is caused because there is a circular reference is the layout parameters.
For example when view B is layout_below View A, view A can't reference view B anymore in it's below, alignRight etc. This can also exist between multiple views: A references B references C. In that scenario C can't reference A because of a circular dependency.
You'll need to evaluate the references again. Does it give you a line number?
Edit:
When I remove these 2 from android:id="#+id/generate_seviye" it works:
android:layout_above="#+id/generatetv1"
android:layout_alignRight="#+id/destekimg"
But you probable need to do some fixing of the layout and check the references.
#+id/view2 has:
android:layout_alignBottom="#+id/generatetv1"
android:layout_alignTop="#+id/generatetv1"
Which seems wrong to me.
I know you should use as little layouts as possible, but adding one linearlayout will probably make it a lot easier

Categories

Resources