小编And*_*ree的帖子

NestedScrollView 问题,在两个屏幕之间切换时抛出错误

我对 NestedScrollView 有一些问题。我已经使用 BottomNavigationBar 实现了 PageView,有时,当我在两个屏幕之间切换时,出现此错误:

'package:flutter/src/widgets/nested_scroll_view.dart':失败的断言:第 501 行 pos 14:'position.minScrollExtent != null && position.pixels != null':不是真的。

在此处输入图片说明

child: NestedScrollView(
      controller: _controller,
      headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
        return <Widget>[
          SliverAppBar(
            automaticallyImplyLeading: false,
            pinned: true,
            expandedHeight: 140.0,
            floating: false,
            centerTitle: true,
            flexibleSpace: FlexibleSpaceBar(
              centerTitle: true,
              background: new Container(
                child: FutureBuilder(
                  future: CoverImagesApi().getImageFile(1),
                  builder: (context, snapshot) {
                    if(snapshot.data != null) {
                      return Container(
                        child: Column(
                          children: <Widget>[
                            Expanded(
                              flex: 5,
                              child: Container(
                                alignment: Alignment.topCenter,
                              ),
                            ),
                            Expanded(
                              flex: 2,
                              child: new Container( …
Run Code Online (Sandbox Code Playgroud)

android dart nestedscrollview flutter

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

上次包含通知被取消时,组摘要通知未取消

我已经为组摘要创建了一个通知,其中可能包含许多通知。
这些通知添加了一些操作addAction()

我尝试在执行操作后取消通知:

NotitifactionCompat.from(context).cancel(notificationId);
Run Code Online (Sandbox Code Playgroud)

不幸的是,当取消的通知是摘要的最后一个时,仅通知本身将被取消,摘要也不会被取消。

我想念什么?

notifications android

8
推荐指数
3
解决办法
1437
查看次数

Android:Magento 2电子商务网站不在android Webview中工作

当我试图在Android中加载Magento 2 电子商务网站时WebView,我收到以下错误消息:

"无法发送cookie.将超出最大cookie数量."

这个错误的原因是什么?我怎样才能解决这个问题.?任何人都可以帮助我吗?

Android代码

WebView webView=(WebView) findViewById(R.id.disp);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setLoadsImagesAutomatically(true);
        webView.getSettings().setLoadWithOverviewMode(true);
        webView.getSettings().setAppCacheEnabled(false);
        webView.getSettings().setAllowContentAccess(true);
        webView.getSettings().setAllowFileAccess(true);
        webView.setWebViewClient(new MyViewClient());
        try {
            webView.loadUrl("https://sweetroomksa.com/");
        }catch (Exception e){


        }
Run Code Online (Sandbox Code Playgroud)

android webview magento2

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

Android 主题启动器活动(启动画面),采用新技术和动画

我知道这是一个基本问题,并且已经被问了数百万次,但我想谈谈一些不同的事情。

首先我们来说说如何实现闪屏。有三种实施方法,其中一种方法比另一种方法有一些好处。然而,也有一些令人沮丧的实施方式。请阅读本文以了解可能的方法。

所以我正在创建我的活动背景主题作为启动活动,就像使用图层列表一样

<?xml version="1.0" encoding="utf-8"?>
Run Code Online (Sandbox Code Playgroud)

<item android:drawable="@color/white"/>

<item android:drawable="@drawable/ic_app_icon"
    android:gravity="center"
    android:width="144dp"
    android:height="144dp"/>
 </layer-list>
Run Code Online (Sandbox Code Playgroud)

因此,我成功地显示了应用程序图标。但我想像 Whatsapp 那样附加一条文本。这是我的两个基本问题

  1. 如何在图层列表中显示带有应用程序图标的文本(请不要告诉我用文本制作图像,我见过whatsapp启动器屏幕,他们的做法不同)

  2. 其次如何为图层列表中的应用程序图标设置动画。有关参考,请参阅 Facebook 启动器屏幕。他们在应用程序启动时动画化他们的徽标。他们是怎么做到的?

请让我知道这样做的新技术是什么?

android splash-screen android-layout android-studio

5
推荐指数
0
解决办法
277
查看次数

Android动态功能模块依赖关系

所以我有几个共享通用代码的功能 - 让我们称它们为“feature1”和“feature2”。我无法将共享代码添加为“feature1”和“feature2”的依赖项 - Android studio 抛出以下错误:

多个 APK 打包同一库可能会导致运行时错误。将上述库添加为基本模块的依赖项将通过将库与基本 APK 一起打包来解决此问题。

所以我想我只是创建另一个动态功能模块 - 让我们称之为“核心” - 在那里传递共享依赖项。这也有效,有点。我可以从“feature1”和“feature2”内的“core”访问所有java类,但是一旦我想访问资源,我就会得到一个ResourceNotFoundException。这些功能是传递调用SplitCompat.install(context)onAttach()函数的片段。

所以我的问题是 - 是否有可能有一个存储公共代码的动态功能模块,或者这一切都应该放在应用程序中?

感谢和问候, 罗曼斯基

android android-app-bundle dynamic-feature-module

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

如何在Android中将可绘制形状渐变应用于android.support.v7.widget.CardView

我无法将背景渐变设置为android.support.v7.widget.CardView

使用app:cardBackgroundColor="@somecolor"此我只设置背景色,而不是可绘制的资源文件

<android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:cardBackgroundColor="@drawable/bg"> // not working in CardView

</android.support.v7.widget.CardView>
Run Code Online (Sandbox Code Playgroud)

bg.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
    <gradient android:angle="45" android:startColor="@android:color/black"
        android:endColor="@android:color/black"
        android:centerColor="@android:color/holo_red_dark"
        android:centerX="4"
        />
</shape>
Run Code Online (Sandbox Code Playgroud)

android gradient drawable android-cardview

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

错误:(40,0)找不到参数[directory'libs']的方法实现()

我试图运行我的Android工作室2天,最后它显示错误400,我的build.gradle文件看起来像这样

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
}
}

allprojects {
repositories {
    jcenter()
}
}
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '25.0.1'
defaultConfig {
    applicationId "com.armenhovhannisyan.backpaper.backpaper"
    minSdkVersion 25
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner                      "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
    }
}
productFlavors {
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-    core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
}) …
Run Code Online (Sandbox Code Playgroud)

android android-studio

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