1
我在Xamarin.Android上有应用程序,我在其中使用了PullToRefresharp。它适用于PC上的模拟器,但它不适用于任何设备。当我试图用此组件启动布局时 - 布局根本不加载。PullToRefresharp在设备上不起作用
<pulltorefresharp.android.views.ViewWrapper
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<pulltorefresharp.android.widget.ScrollView
android:id="@+id/textAreaScroller"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_x="0px"
android:layout_y="25px"
android:scrollbars="vertical">
<LinearLayout
android:minWidth="25px"
android:minHeight="25px"
android:orientation="vertical"
android:background="#E6E7E8"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/linearLayout1">
<TableLayout
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/archive_table" />
</LinearLayout>
</pulltorefresharp.android.widget.ScrollView>
</pulltorefresharp.android.views.ViewWrapper>
后面的代码:
scrollView = FindViewById<PullToRefresharp.Android.Widget.ScrollView>(Resource.Id.textAreaScroller);
if (scrollView != null) {
scrollView.RefreshActivated += HandleRefreshActivated;
}
private void HandleRefreshActivated (object sender, EventArgs e)
{
scrollView.OnRefreshCompleted();
}
可能是我设置didin't任何财产。我希望有人能帮助我。
也许你可以解释为什么你的代码工作,他没有,或者他的代码丢失。 –
我更喜欢使用原生的Android控件,我从来没有使用他使用的控件,但本地控件完美地适用于我 –
我试图按照上面的建议使用SwipeRefreshLayout,但我有错误:[mono-rt] android。 view.InflateException:二进制XML文件行#1:错误膨胀类swipetorefresh.ScrollChildSwipeRefreshLayout –