2017-06-15 1 views
0

Ich habe ein Formular in meiner App, es richtig anzeigen und in einigen meiner Mitte zentrieren, aber in Micromax Telefon es auf der rechten Seite des Bildschirms verschoben. Im Folgenden finden Sie Screenshot - enter image description hereAndroid-Layout-Shift auf der rechten Seite des Bildschirms in Micromax-Gerät

und unten ist mein xml Code-

<?xml version="1.0" encoding="utf-8"?> 

<ScrollView 
    android:layout_below="@+id/header_ll" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fillViewport="true"> 

    <RelativeLayout 
     android:background="@drawable/input_bg" 
     android:layout_margin="@dimen/dimen20" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <TextView 
      android:id="@+id/title_tv" 
      android:textSize="@dimen/text14" 
      android:textColor="#A9A9A9" 
      android:padding="@dimen/dimen20" 
      android:text="@string/create_announcement_message" 
      android:layout_centerHorizontal="true" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 

     <TextView 
      android:id="@+id/type_tv" 
      android:layout_below="@+id/title_tv" 
      android:textSize="@dimen/text14" 
      android:textColor="@color/black" 
      android:padding="@dimen/dimen20" 
      android:text="@string/select_message_type" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 

     <RadioButton 
      android:id="@+id/text_rb" 
      android:layout_below="@+id/type_tv" 
      android:text="Text" 
      android:layout_marginLeft="@dimen/dimen20" 
      android:padding="@dimen/dimen10" 
      android:textColor="@color/black" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 

     <RadioButton 
      android:id="@+id/image_rb" 
      android:layout_toRightOf="@+id/text_rb" 
      android:layout_below="@+id/type_tv" 
      android:text="Image" 
      android:layout_marginLeft="@dimen/dimen20" 
      android:padding="@dimen/dimen10" 
      android:textColor="@color/black" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 

     <EditText 
      android:id="@+id/title_et" 
      android:background="@drawable/input_bg" 
      android:layout_below="@+id/text_rb" 
      android:textSize="@dimen/text14" 
      android:textColor="@color/black" 
      android:textColorHint="#A9A9A9" 
      android:minLines="1" 
      android:maxLines="1" 
      android:singleLine="true" 
      android:hint="@string/enter_title_hint" 
      android:imeOptions="actionNext" 
      android:layout_margin="@dimen/dimen20" 
      android:padding="@dimen/dimen20" 
      android:layout_centerHorizontal="true" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" /> 

     <EditText 
      android:id="@+id/message_et" 
      android:background="@drawable/input_bg" 
      android:layout_below="@+id/title_et" 
      android:textSize="@dimen/text14" 
      android:textColor="@color/black" 
      android:textColorHint="#A9A9A9" 
      android:minLines="5" 
      android:maxLines="5" 
      android:visibility="visible" 
      android:singleLine="false" 
      android:scrollbars="none" 
      android:gravity="top|left" 
      android:hint="@string/enter_message_hint" 
      android:imeOptions="actionDone" 
      android:layout_margin="@dimen/dimen20" 
      android:padding="@dimen/dimen20" 
      android:layout_centerHorizontal="true" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" /> 

     <RelativeLayout 
      android:id="@+id/image_container_rl" 
      android:layout_below="@+id/message_et" 
      android:visibility="gone" 
      android:layout_centerHorizontal="true" 
      android:layout_marginLeft="@dimen/dimen20" 
      android:layout_marginRight="@dimen/dimen20" 
      android:layout_marginBottom="@dimen/dimen20" 
      android:background="@drawable/input_bg" 
      android:layout_width="match_parent" 
      android:layout_height="160dp"> 

      <TextView 
       android:id="@+id/choose_image_tv" 
       android:layout_centerInParent="true" 
       android:text="Select image" 
       android:textColor="#A9A9A9" 
       android:textSize="@dimen/text16" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <ImageView 
       android:id="@+id/image_iv" 
       android:layout_centerInParent="true" 
       android:scaleType="centerInside" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

     </RelativeLayout> 

     <Button 
      android:id="@+id/submit_btn" 
      android:textSize="@dimen/text16" 
      android:layout_alignParentBottom="true" 
      android:layout_marginTop="@dimen/dimen20" 
      android:textColor="@color/White" 
      android:text="@string/submit" 
      android:gravity="center" 
      android:background="@drawable/button_bottom_round_bg" 
      android:textStyle="bold" 
      android:layout_width="match_parent" 
      android:layout_height="56dp" /> 
    </RelativeLayout> 

</ScrollView> 

Ich habe versucht, eine Menge, aber keine Lösung gefunden. Jede Hilfe sehr geschätzt. Vielen Dank im Voraus.

Antwort

0

Entfernen Sie diese Zeile ..

android:fillViewport="true" 
Verwandte Themen