小编Raf*_*vfe的帖子

将自定义弹出窗口/视图添加到android中的活动

我正在开始Android开发,但仍然不知道如何执行此操作。我有一个ListView,当用户点击其中一个我不想显示的信息时,便会显示一个ListView。这样的弹出窗口: 在此处输入图片说明

那就是它的外观,我已经有了这样的XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#b5000000">

<RelativeLayout
    android:layout_width="340dp"
    android:layout_height="400dp"
    android:columnCount="20"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true"
    android:padding="10dp"
    android:background="@drawable/menubutton">

    <Button
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:text="X"
        android:id="@+id/infraccionesPopUpCerrar"
        android:layout_gravity="right|top"
        android:layout_row="0"
        android:layout_column="19"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true" />

    <ImageView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:id="@+id/imageView8"
        android:layout_row="2"
        android:layout_column="10"
        android:layout_below="@+id/infraccionesPopUpCerrar"
        android:layout_centerHorizontal="true" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:text="Aqui se detallaran las causas de la infraccion"
        android:id="@+id/infraccionesPopUpCausa"
        android:layout_column="0"
        android:layout_row="3"
        android:layout_columnSpan="20"
        android:layout_below="@+id/imageView8"
        android:layout_alignParentStart="true"
        android:layout_marginTop="43dp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="Small Text"
        android:id="@+id/infraccionesPopUpFecha"
        android:layout_alignParentTop="true"
        android:layout_alignParentStart="true" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="PAGADA"
        android:id="@+id/infraccionesPopUpSituacion"
        android:layout_below="@+id/infraccionesPopUpCausa"
        android:layout_alignStart="@+id/infraccionesPopUpCausa" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="Folio: 00000000" …
Run Code Online (Sandbox Code Playgroud)

java user-interface android

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

java ×1

user-interface ×1