小编lob*_*uli的帖子

无法在对话框片段中滚动

我试图DialogFragment弹出并显示可滚动TextView图例,但它只是切断了图例的其余部分。我无法滚动浏览它或任何东西。我尝试添加 aScrollView但它没有任何作用。这是我得到的屏幕:

在此输入图像描述

这是我的 XML 布局文件:

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

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

    <LinearLayout android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:scrollbars="vertical"
        android:scrollbarAlwaysDrawVerticalTrack="true"
        android:background="#fff">

        <TextView
            android:id="@+id/layer_legend_title_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:background="#fff"
            android:textColor="#000" />

        <ListView
            android:id="@+id/layer_legend_symbols_listview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:background="#fff"
            android:textColor="#000" />

    </LinearLayout>

</ScrollView>
Run Code Online (Sandbox Code Playgroud)

我运行此命令将内容添加到TextView

/**
 * A dialog that shows the legend of a ArcGISDynamicMapServiceLayer.
 */
public class LegendDialogFragment extends DialogFragment implements View.OnClickListener {

    public static final String TAG = LegendDialogFragment.class.getSimpleName();
    private LinearLayout mLinearLayout;
    private ArcGISDynamicMapServiceLayer …
Run Code Online (Sandbox Code Playgroud)

android arcgis android-layout android-scrollview android-dialogfragment

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