小编Tou*_*der的帖子

Splash屏幕之前的黑屏出现在android中

我们知道,当应用程序做一些漫长的过程,比如从互联网上下载一些信息时,它可能会在加载应用程序之前显示启动画面,当应用程序完全加载时,它将显示主页面.在启动画面活动中,我们必须在线程中加载长进程,以避免在加载应用程序之前显示黑屏.我做了所有这些.但在显示应用程序之前还会出现黑屏.这是启动画面活动的onCreate方法:

    protected override void OnCreate (Bundle bundle)
    {
        try {
            base.OnCreate (bundle);
            //_dt = DateTime.Now.AddSeconds (_splashTime);
            SetContentView (Resource.Layout.Splash );
            FirstLoadPB= FindViewById <ProgressBar >(Resource .Id.FirstLoadPB );
            FirstLoadingInfo= FindViewById <TextView >(Resource .Id.FirstLoadInfo );
            LoadApplication ();

        } catch (System.Exception ex) {

            Common.HandleException (ex);
        }
    }
Run Code Online (Sandbox Code Playgroud)

这是LoadApplication方法的代码:

public void LoadApplication()
    {
        new System.Threading.Thread (new ThreadStart (() =>
                                                      {
        //Some Codes to load applications- Downloading from web and accessing the storage(Because was many codes - about 100 line- i was clear them.

        } …
Run Code Online (Sandbox Code Playgroud)

android splash-screen xamarin.android

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

Android Studio Assistant:没有客户端可以添加到您的Firebase项目中

在Android Studio中使用新的(Firebase)助手添加新服务时,我收到此错误:

火力地堡

由于以下原因,没有客户能够添加到您的Firebase项目中:具有此软件包名称和SHA1的应用已连接到Google项目.如果您之前使用过Google API,请在"连接到现有项目"列表中选择该项目.

在Firebase控制台页面上,我选择了该选项IMPORT GOOGLE PROJECTS,然后继续集成Firebase服务.但是,当我尝试使用Android Studio Firebase助手添加更多服务时,我收到上述错误.

而我"in the Connect to an existing Project list"在任何地方都找不到这个?

android google-api firebase firebase-assistant

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

Android Studio 2.0(预览3b)布局xml更改未在apk中更新?

当我对布局资源文件进行更改时,当从Android Studio 2.0(预览3b)构建并安装apk文件时,它不会更新/反映.

示例:我有一个EditText,我添加了TextInputLayout这样的:

<android.support.design.widget.TextInputLayout
    android:id="@+id/input_layout_new_password"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp">

    <EditText
        android:id="@+id/edit_text_new_password"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/hint_your_new_password"
        android:inputType="textPassword"
        android:saveEnabled="false" />

</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)

更新应用程序后的结果与我添加之前的结果相同TextInputLayout,只是EditText没有TextInputLayout.

我尝试过的:

  • 建立/清洁项目
  • 建立/重建项目
  • 文件/无效缓存/重新启动..
  • 首先卸载应用程序
  • 关闭即时运行

我怀疑这可能是预览3b版本的Android Studio 2.0导致此问题的一个错误.有任何想法吗?也许它只是一个设置/配置?

android android-layout instant-run android-studio-2.0

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

WKWebView iOS 13 中的 DeviceMotion 和 DeviceOrientation

我想在 iOS 13+ 中使用DeviceMotion和DeviceOrientation事件WKWebView。我正在使用下面的代码

<html>
    <style>
        #container{
            margin: 20px; 
            padding: 20px
        }
        #deviceType{
            text-align: center; 
            font-family: Arial, Helvetica, sans-serif; 
            font-size: 3rem;
            font-weight: bold; 
            color: #08f
        }
        #permission{
            padding: 2rem 5rem;
            background: #08f;
            color: white; 
            margin-top: 30;
            font-family: Arial, Helvetica, sans-serif; 
            font-size: 3rem;
            border: none; 
            border-radius: 1rem
        }
        #permissionStatus{
            text-align: center; 
            font-family: Arial, Helvetica, sans-serif; 
            font-size: 2.5rem;
            font-weight: 600; 
            color: red;
            margin-top: 30px
        }
    </style>
    <body>
        <div id="container">
                <div id="deviceType"></div>
                <div style="text-align: center">
                    <button id="permission">Ask …
Run Code Online (Sandbox Code Playgroud)

ios devicemotion wkwebview ios-permissions

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