FORUMS

default alignment reversed

1 posts
Thanks Meter: 0
 
By android_devel, Junior Member on 30th June 2020, 10:10 PM
Post Reply Email Thread
Hello,

I have a strange problem that on some devices, like galaxy s8 and LG G6 , the default alignment is reversed.
(But on most galaxy s8 and LG G6 devices its is ok)

The default alignment for a TextView is Left but on some devices it is Right. I solved it by adding "android:layout_alignParentLeft="true"
The same is true for buttons and EditText.

But there are some more strange things with the alignment, see the screenshots below:
"alignment wrong"
alignment wrong

"alignment ok"
alignment ok

What can cause this alignment problem, it's not the device self i think, but maybe its related to the country or language settings?


part of XML code:
Code:
<RelativeLayout
                    android:id="@+id/widget1"
                    android:background="@color/background"
                    android:layout_below="@+id/widget0"
                    android:layout_alignParentBottom="true"
                    android:layout_centerHorizontal="true"
                    android:layout_height="wrap_content"
                    android:layout_width="wrap_content">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textSize="15sp"
                        android:text="Z1"
                        android:layout_alignParentLeft="true"
                        android:id="@+id/_bandstop_filter_g0"
                        android:layout_alignBaseline="@+id/bandstop_filter_g0"
                        android:layout_marginStart="15dp"
                        android:layout_marginEnd="3dp" />

                    <EditText
                        android:layout_marginBottom="3dp"
                        android:textColor="@color/gui_text1"
                        android:focusable="false"
                        android:background="@drawable/shape_edittext_lock"
                        android:paddingLeft="8dp"
                        android:layout_height="30dp"
                        android:textSize="15sp"
                        android:inputType="numberSigned|numberDecimal"
                        android:id="@+id/bandstop_filter_g0"
                        android:layout_width="82dp"
                        android:layout_toRightOf="@+id/_bandstop_filter_g0"
                        android:layout_marginTop="5dp" />

                    <TextView
                        android:id="@+id/bandstop_filter_g0_"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBaseline="@+id/bandstop_filter_g0"
                        android:layout_marginStart="3dp"
                        android:layout_toRightOf="@+id/bandstop_filter_g0"
                        android:text="Ω"
                        android:textSize="15sp"
                         />
                    
                    <TextView
                        android:id="@+id/_bandstop_filter_2g0"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBaseline="@+id/bandstop_filter_g0"
                        android:layout_marginStart="28dp"
                        android:layout_marginEnd="3dp"
                        android:layout_toRightOf="@+id/bandstop_filter_g0_"
                        android:text="Z2"
                        android:textSize="15sp"
                       />

                    <EditText
                        android:layout_marginBottom="3dp"
                        android:textColor="@color/gui_text1"
                        android:focusable="false"
                        android:background="@drawable/shape_edittext_lock"
                        android:paddingLeft="8dp"
                        android:layout_height="30dp"
                        android:textSize="15sp"
                        android:inputType="numberSigned|numberDecimal"
                        android:id="@+id/bandstop_filter_2g0"
                        android:layout_width="82dp"
                        android:layout_toRightOf="@+id/_bandstop_filter_2g0"
                        android:layout_alignBaseline="@+id/bandstop_filter_g0" />

                    <TextView
                        android:id="@+id/bandstop_filter_2g0_"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignBaseline="@+id/bandstop_filter_g0"
                        android:layout_marginStart="3dp"
                        android:layout_toRightOf="@+id/bandstop_filter_2g0"
                        android:text="Ω"
                        android:textColor="@color/gui_text1"
                        android:textSize="15sp"
                         />
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes