-1

我在android弹出窗口中使用文本字段。但是在文本字段中没有复制/粘贴选项。我在不同的活动中使用了相同的文本字段,并且工作正常。我弹出的xml如下:如何在Android弹出窗口中启用复制和粘贴文本字段

<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> 

弹出窗口没有java类。尝试不同的方法,如isSelectable,但没有帮助..请帮助。 谢谢

+0

你可以使用[android:textIsSelectable](https://developer.android.com/reference/android/widget/TextView.html) – TranHieu

回答

0

我终于找到了替代这个,通过替换弹出与对话框片段。现在它工作正常。从深入搜索互联网,我才知道这是从谷歌弹出的错误。 对话框片段工作正常。 无论如何感谢您花费宝贵的时间...

相关问题