-1

I Textfeld in Android in einem Popup verwenden. Aber es gibt keine Kopier-/Einfügeoption im Textfeld. Ich habe das gleiche Textfeld in verschiedenen Aktivitäten verwendet, und es funktioniert gut. Mein Popup-XML ist unten:Wie Kopie aktivieren und in Textfeld in android Popup einfügen

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/popup_element" 
     android:background="@color/colorPrimary" 
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
    android:weightSum="1"> 

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

     <TextView 
      android:text="Add HTTP Link" 
      android:textSize="25dp" 
      android:textStyle="bold" 
      android:textColor="@color/colorwhite" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/textView2" 
      android:layout_centerVertical="true" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentStart="true" 
      android:layout_marginLeft="17dp" 
      android:layout_marginStart="17dp" 
      android:textAppearance="@style/TextAppearance.AppCompat.Body2" /> 
    </RelativeLayout> 

    <LinearLayout 
     android:background="@color/colorwhite" 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

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

      <Button 
       android:id="@+id/btn_close_popup" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:textColor="@color/colorPrimaryDark" 
       android:text="Cancel" 
       android:layout_alignBaseline="@+id/button_download" 
       android:layout_alignBottom="@+id/button_download" 
       android:layout_toRightOf="@+id/button_download" 
       android:layout_toEndOf="@+id/button_download" 
       android:layout_weight="1" /> 

      <Button 
       android:text="Download" 
       android:textColor="@color/colorPrimaryDark" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/button_download" 
       android:layout_marginLeft="62dp" 
       android:layout_marginStart="62dp" 
       android:layout_marginBottom="18dp" 
       android:layout_weight="1" 
       android:layout_alignParentBottom="true" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <android.support.design.widget.TextInputLayout 
       android:id="@+id/texthttp" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="90dp" 
       android:layout_alignParentTop="true" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true"> 
       <EditText 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:inputType="textUri" 
        android:hint="Http Link" /> 
      </android.support.design.widget.TextInputLayout> 



     </RelativeLayout> 

    </LinearLayout> 

</LinearLayout> 

Es gibt keine Java-Klasse für das Popup. Versucht verschiedene Methoden wie isSelectable, aber keine Hilfe .. Bitte helfen. Danke

+0

können Sie [Android: textIsSelectable] (https://developer.android.com/reference/android/widget/TextView.html) – TranHieu

Antwort

0

ich endlich eine Alternative dazu gefunden, durch Popup mit Dialog-Fragmente zu ersetzen. Jetzt funktioniert es gut. Aus tiefer Suche im Internet habe ich erfahren, dass es sich um einen Popup-Bug von Google handelt. Dialog Fragment funktioniert gut. Wie auch immer, danke für Ihre wertvolle Zeit ...

Verwandte Themen