问题:项目中有个主题为android:theme="@style/AppTheme.Light.Dialog"的Activity,在从服务器上拉去数据后使用PullToRefreshListView来显示数据。部分代码为
加载数据后显示错误,数据并没有显示出来,如图所示:
产生原因:PullToRefreshListView用来显示内容的部分是FrameLayout中的ListView,Activity加载成功时PullToRefreshListView没有加载数据,ListView和FrameLayout的高度都为0.
解决办法,修改PullToRefreshListView源码,将PullToRefreshBase中获取FrameLayout的方法私有改成公有。
获取PullToRefreshListView中的FrameLayout后,在Activity的onCreate()方法中手动指定高度,
运行后显示的效果
问题解决