2016-06-29 9 views
0

Zuerst entschuldige ich mich für Englischkenntnisse Ich entwickle ein Projekt und ich habe ein Problem. Dies ist meine Tastatur wird Push-Ansicht, wenn es angezeigt wird, will ich das nicht! Wie man es macht. Vielen Dank. Das ist mein code` Machen Sie Tastatur nicht nach oben zu schieben Android

<LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 

     <ScrollView 
      android:layout_weight="1" 
      android:layout_width="match_parent" 
      android:layout_height="0dp"> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="vertical"> 


       <RelativeLayout 
        android:layout_width="match_parent" 
        android:layout_height="200dp"> 

        <TextView 
         android:id="@+id/tvNoPhoto" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:background="@color/colorBackGroundInfoMain" 
         android:gravity="center" 
         android:text="This place don't have any photos yet" 
         android:textColor="@color/black" 
         android:visibility="visible" /> 

        <com.libreteam.beliat.common.ClickableViewPager 
         android:id="@+id/pageImageAddPlace" 
         android:layout_width="match_parent" 
         android:layout_height="200dp" 
         android:visibility="visible"></com.libreteam.beliat.common.ClickableViewPager> 

        <RelativeLayout 
         android:id="@+id/viewPagerIndicator" 
         android:layout_width="match_parent" 
         android:layout_height="50dp" 
         android:layout_alignParentBottom="true" 
         android:layout_marginTop="5dp" 
         android:gravity="center"> 

         <TextView 
          android:id="@+id/tvCountImage" 
          android:layout_width="match_parent" 
          android:layout_height="20dp" 
          android:gravity="center" 
          android:textColor="@color/white" /> 

         <LinearLayout 
          android:id="@+id/viewPagerCountDots" 
          android:layout_width="match_parent" 
          android:layout_height="30dp" 
          android:layout_below="@+id/tvCountImage" 
          android:layout_centerHorizontal="true" 
          android:gravity="center" 
          android:orientation="horizontal" /> 


        </RelativeLayout> 

       </RelativeLayout> 

       <LinearLayout 
        android:gravity="center_vertical" 
        android:layout_width="match_parent" 
        android:layout_height="40dp" 
        android:background="@color/colorItemMenuNoClick" 
        android:orientation="horizontal"> 

        <ImageView 
         android:layout_marginLeft="10dp" 
         android:id="@+id/imgUpLoad" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:background="@drawable/ic_upload" /> 

        <View 
         android:layout_width="wrap_content" 
         android:layout_height="40dp" 
         android:layout_weight="1" /> 

        <ImageView 
         android:layout_marginRight="10dp" 
         android:id="@+id/imgDelete" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:background="@drawable/ic_trash" /> 
       </LinearLayout> 

       <TextView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:background="@color/colorRoundSignUp" 
        android:paddingBottom="10dp" 
        android:paddingLeft="10dp" 
        android:paddingRight="10dp" 
        android:paddingTop="10dp" 
        android:text="Place Information" 
        android:textColor="@color/colorButtonLogInFB" 
        android:textStyle="bold" /> 

       <EditText 
        android:id="@+id/tvPlaceName" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:background="@color/white" 
        android:drawableRight="@drawable/ic_edit_18" 
        android:hint="Place Name" 
        android:paddingBottom="10dp" 
        android:paddingLeft="10dp" 
        android:paddingRight="10dp" 
        android:paddingTop="10dp" 
        android:singleLine="true" 
        android:textColor="@color/black" /> 

       <View 
        android:layout_width="match_parent" 
        android:layout_height="1dp" 
        android:background="@color/colorBackGroundInfoMain"></View> 

       <EditText 
        android:id="@+id/tvShortDescription" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:background="@color/white" 
        android:drawableRight="@drawable/ic_edit_18" 
        android:hint="Short Description" 
        android:inputType="textEmailAddress" 
        android:paddingBottom="10dp" 
        android:paddingLeft="10dp" 
        android:paddingRight="10dp" 
        android:paddingTop="10dp" 
        android:singleLine="true" 
        android:textColor="@color/black" /> 

       <View 
        android:layout_width="match_parent" 
        android:layout_height="1dp" 
        android:background="@color/colorBackGroundInfoMain"></View> 

       <EditText 
        android:id="@+id/tvAddress" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:background="@color/white" 
        android:drawableRight="@drawable/ic_edit_18" 
        android:hint="Address" 
        android:paddingBottom="10dp" 
        android:paddingLeft="10dp" 
        android:paddingRight="10dp" 
        android:paddingTop="10dp" 
        android:singleLine="true" /> 

       <TextView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:background="@color/colorRoundSignUp" 
        android:paddingBottom="10dp" 
        android:paddingLeft="10dp" 
        android:paddingRight="10dp" 
        android:paddingTop="10dp" 
        android:text="Place Category" 
        android:textColor="@color/colorButtonLogInFB" 
        android:textStyle="bold" /> 

       <TextView 
        android:id="@+id/tvChooseCategory" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:background="@color/white" 
        android:drawableRight="@drawable/ic_edit_18" 
        android:hint="Choose a category for place" 
        android:paddingBottom="10dp" 
        android:paddingLeft="10dp" 
        android:paddingRight="10dp" 
        android:paddingTop="10dp" 
        android:singleLine="true" 
        android:textColor="@color/black" 
        android:textSize="17sp" /> 

       <TextView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:background="@color/colorRoundSignUp" 
        android:paddingBottom="10dp" 
        android:paddingLeft="10dp" 
        android:paddingRight="10dp" 
        android:paddingTop="10dp" 
        android:text="Location on the map" 
        android:textColor="@color/colorButtonLogInFB" 
        android:textStyle="bold" /> 

       <RelativeLayout 
        android:layout_width="match_parent" 
        android:layout_height="200dp"> 
        <fragment xmlns:android="http://schemas.android.com/apk/res/android" 
         xmlns:tools="http://schemas.android.com/tools" 
         android:id="@+id/mMap" 
         android:name="com.google.android.gms.maps.SupportMapFragment" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         tools:context=".MainActivity" /> 

        <View 
         android:alpha="0.5" 
         android:background="@color/colorItemMenuNoClick" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent"/> 

        <TextView 
         android:textSize="20sp" 
         android:textColor="@color/white" 
         android:gravity="center" 
         android:text="Change location on the map" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" /> 

       </RelativeLayout> 




      </LinearLayout> 
     </ScrollView> 
     <TextView 
      android:id="@+id/btnSavePlace" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:background="@color/colorButtonSignUp" 
      android:gravity="center" 
      android:padding="20dp" 
      android:text="Save place" 
      android:textColor="@color/white" /> 
    </LinearLayout> 



    <RelativeLayout 
     android:id="@+id/layout_pickImage" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="#8C000000" 
     android:clickable="true" 
     android:visibility="gone"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:orientation="vertical"> 

      <Button 
       android:id="@+id/btnFromCamera" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:background="@color/colorBackGroundInfo" 
       android:text="@string/from_camera" 
       android:textColor="@color/white" /> 

      <Button 
       android:id="@+id/btnFromGallery" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="5dp" 
       android:background="@color/colorBackGroundInfo" 
       android:text="@string/from_gallery" 
       android:textColor="@color/white" /> 

      <Button 
       android:id="@+id/btnCancel" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="5dp" 
       android:background="@color/colorBackGroundInfo" 
       android:text="@string/cancel" 
       android:textColor="@color/white" /> 
     </LinearLayout> 
    </RelativeLayout> 

</RelativeLayout>` 
+0

U bedeuten android Tastatur ist Ihre Ansicht versteckt durch Drücken es nach oben? – TapanHP

+0

Danke, ich will Tastatur nicht btnSavePlace zur oberen Tastatur schieben, sondern btnSavePlace immer am unteren Bildschirmrand! –

+0

Ok sehe meine Antwort und ich werde auch versuchen, Ihren Code nach einiger Zeit und geben Sie eine Lösung @HangThanh – TapanHP

Antwort

0

Es gibt Zeiten Situation sicher, wenn Sie alle Inhalte erreichbar wollen oder manchmal Sie wollen es nicht wie in Ihrem Fall Android eine Eigenschaft für Tastatureinstellungen hat, können Sie es einfach tun indem Sie es in AndroidMenifest-Datei ändern Es ist windowsSoftInputMode. vielleicht ist es gerade jetzt passen oder anpassenResize, so dass es den Inhalt ganz nach oben zwingt. Wenn Sie nichts wollen, dann stellen Sie diese Eigenschaft überhaupt nicht ein, damit es sich an das Standardverhalten hält. Möchten Sie mehr darüber erfahren? Überprüfen Sie die unten stehenden Links für das Tiefenverständnis, Danke.

Entwicklerdokumentation
https://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
ähnliche Links
https://stackoverflow.com/a/7509285/5476209
und
Difference between adjustResize and adjustPan in android?

+0

Vielen Dank Mist! Alles Gute für dich –

+0

Entschuldigung, aber ich habe nicht genug Ruf! :( –

Verwandte Themen