小编Xhu*_*lio的帖子

如何在加载数据时获取WebView的进度,Xamarin.Forms

我正在使用Xamarin.Forms开发一个应用程序来列出来自不同来源的新闻.我使用webView打开与新闻相对应的链接.但我希望在将网页加载到Web视图时显示进度,例如Safari App上的进度条.为此,我使用了ProgressBar元素,如下所示:

<StackLayout>
            <!-- WebView needs to be given height and width request within layouts to render. -->

            <ProgressBar Progress ="" HorizontalOptions="FillAndExpand" x:Name="progress"/>
            <WebView x:Name="webView" 
                     HeightRequest="1000"
                     WidthRequest="1000"  
                     VerticalOptions= "FillAndExpand" 
                     Navigating="webOnNavigating"
                     Navigated="webOnEndNavigating"/>
        </StackLayout>
Run Code Online (Sandbox Code Playgroud)

并在我使用的代码中

void webOnNavigating (object sender, WebNavigatingEventArgs e)
        {
            progress.IsVisible = true;

        }

        void webOnEndNavigating (object sender, WebNavigatedEventArgs e)
        {
            progress.IsVisible = false;
        }
Run Code Online (Sandbox Code Playgroud)

但我想展示加载数据的进度,而不仅仅是加载和加载的指示.我希望用户知道数据正在加载.有没有办法实现这一目标.

progress webview progress-bar xamarin.forms

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

YouTubePlayer与AppCompat v7库一起使用

我开发了一款用于YouTube android API在应用内播放特定视频的应用.那时我已经使用了目标API 19,并且还使用了目标API 19.现在我想改变应用程序切换到Material Design使用目标API 22并使用的设计AppCompat-v7 :22+ library.但YouTubeBaseActivity无法打开,应用程序崩溃.下面我将发布到目前为止我所做的事情.

EventDetail.java

public class EventDetail extends YouTubeBaseActivity implements
        YouTubePlayer.OnInitializedListener { .
.
.
protected void onCreate(Bundle savedInstanceState) {

        // remove the shadow from action bar
        setTheme(R.style.Theme_TranslucentActionBar_ActionBar_NoOverlay);

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_event_detail);

        // enable back button

        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        // setting the action bar initially transparent
        mActionBarBackgroundDrawable = new ColorDrawable(
                Color.parseColor("#ec5c59"));
        mActionBarBackgroundDrawable.setAlpha(0);

        getSupportActionBar().setBackgroundDrawable(mActionBarBackgroundDrawable);

        // binding the scrollview

...
Run Code Online (Sandbox Code Playgroud)

清单文件

<activity
        android:name="com.dev.apk.evente.al.EventDetail"
        android:icon="@drawable/ikona_projekte"
        android:label="@string/title_activity_event_detail"
        android:screenOrientation="portrait"
        android:theme="@style/Theme.TranslucentActionBar.ActionBar.Overlay" />
Run Code Online (Sandbox Code Playgroud)

Layut文件:

<RelativeLayout
    android:id="@+id/video_layout" …
Run Code Online (Sandbox Code Playgroud)

android android-appcompat android-youtube-api android-5.0-lollipop

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

我更新Xamarin.Forms后无法运行该应用程序

好的,这是事情:

  1. 我正在使用Xamarin.Form构建一个针对iOS和Android的应用程序.我正在使用Xamarin Studio for Mac
  2. 我创建了应用程序,解决方案创建了App,App.Droid,App.iOS项目.
  3. 在每个项目中都有一个迹象表明某些包需要更新.
  4. 我在三星S5 API 21中运行Droid项目,没有进行更新,应用程序安装在设备中.
  5. 我更新了这些软件包,根据这个问题的反馈更新了20.0.+版本中的Xamarin.Form:https://forums.xamarin.com/discussion/57283/unable-to-find-a-version- of-xf-compatible-with所以我只是更新了Xamarin.Form包.
  6. 我在三星S5 21中再次运行,但有一些错误: /Users/crs/Projects/time.al/Droid: Error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and extract it to the /Users/crs/.local/share/Xamarin/Android.Support.v4/23.0.1.3/content directory. (XA5209) (time.al.Droid)

我能做什么,因为我需要将Xamarin.Forms更新到最新版本,但我很长时间都坚持这个.

android xamarin.ios xamarin-studio xamarin.forms

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