小编Moh*_*har的帖子

按钮宽度匹配父级:颤动

我是Flutter的新手,所以我想知道如何设置宽度以匹配父布局宽度

 new Container(
              width: 200.0,
              padding: const EdgeInsets.only(top: 16.0),
              child: new RaisedButton(
                child: new Text(
                    "Submit",
                    style: new TextStyle(
                      color: Colors.white,
                    )
                ),
                colorBrightness: Brightness.dark,
                onPressed: () {
                  _loginAttempt(context);
                },
                color: Colors.blue,
              ),
            ),
Run Code Online (Sandbox Code Playgroud)

我对Expanded标签知之甚少,但Expanded扩展视图向两个方向,我不知道该怎么做.如果你知道,请帮助我,先谢谢你.

dart flutter flutter-layout

59
推荐指数
10
解决办法
7万
查看次数

在默认Web浏览器中打开URL

我是反应原生的新手,我想在默认浏览器中打开网址,例如Android和iPhone中的Chrome.

我们通过Android中的意图打开网址,就像我想要实现的功能一样.

我有很多次搜索,但它会给我Deepklinking的结果.

android ios react-native

55
推荐指数
4
解决办法
6万
查看次数

Kotlin:null不能是非null类型kotlin的值

如何ArrayList在Kotlin中分配空值?

我想尝试将null值添加到我的自定义ArrayList

var mList = ArrayList<CustomClass>()
mList.add(null)
Run Code Online (Sandbox Code Playgroud)

在java中它可能但我怎样才能在Kotlin中实现这一点?我正进入(状态

null不能是非null类型kotlin的值

我需要插入null值以在RecyclerView中加载更多功能

android arraylist kotlin android-recyclerview

10
推荐指数
2
解决办法
6125
查看次数

Flutter:如何删除Listview中行之间的空间

我只是在做一些颤振的演示,我喜欢这样做,在列表视图中,我不知道如何删除行之间的空间

在此处输入图片说明

我的代码很简单,这是我返回到我的布局的小部件

Widget _getWidget(BuildContext context) {
return new Material(
    child: new Container(
      padding: EdgeInsets.only(top: 20.0),
      color: Colors.blueGrey[500],
      child: new Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          _getHeader(context),
          new Expanded(child: getListView())
        ],
      ),
    ),
);
Run Code Online (Sandbox Code Playgroud)

}

这是列表视图

 ListView getListView() =>
      new ListView.builder(
          itemCount: widgets.length,
          itemBuilder: (BuildContext context, int position) {
            return getRow(position);
          });
Run Code Online (Sandbox Code Playgroud)

这是我使用卡片视图的行

 Widget getRow(int i) {
    return new Padding(padding: new EdgeInsets.all(10.0),
        child: new Card(
          child: new Column(
            children: <Widget>[
              new ListTile(
                title: new Text(
                    "Name : ${widgets[i].username}"
                ),
                subtitle: new …
Run Code Online (Sandbox Code Playgroud)

listview dart flutter flutter-layout

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

滑动BottomSheet像谷歌地图

目前我正在使用这个lib的底页,我想实现像谷歌地图一样的图像动画, 同时滑动底片,我想按照显示的图像滑动imageview,我已经使用这个链接寻求帮助但是没有得到.我一直在尝试这么多时间,但无法找到任何解决方案,任何帮助都可以得到赞赏.提前致谢..

android google-maps googleio

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

Android DarkMode:价值之夜不起作用

我正在我的应用程序中开发 Day/Night 功能,所以我阅读了这些文档并开始开发它。

使用 deligate 方法在 Day 或 Night 中使用默认值可以正常工作AppCompatDelegate.setDefaultNightMode(*)

为了自定义夜间主题颜色,我创建了values-night文件夹,并在里面创建了如下所示的colours.xml文件。

res -> values -> colors.xml
res -> values-night -> colors.xml
Run Code Online (Sandbox Code Playgroud)

在我放置该颜色但未应用于 Night 主题之后!很奇怪为什么价值夜间颜色并不总是应用其显示的默认夜间颜色?我研究了一些,但找不到解决方案。

注意:重新创建活动解决了我的问题,但我不想重新创建

这是我的 build.gradle 文件

在此处输入图片说明

提前谢谢。

android android-theme android-darkmode

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

Glide V4 加载 https 图像

我知道这个链接,并尝试过,但这适用于 Glide V3 解决方案,我需要加载https://myimage/image/xxx.png但 glide 抛出异常

FileNotFoundException(No content provider)** and **SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found
Run Code Online (Sandbox Code Playgroud)

我正在使用 4.5.0 Glide 版本,我花了很多时间但找不到任何解决方案,任何帮助将不胜感激。

android image-loading sslhandshakeexception android-glide

6
推荐指数
2
解决办法
9608
查看次数

应用程序中的 JNI 检测错误:JNI FindClass 被调用并带有未决异常 java.lang.NoSuchMethodError:没有非静态方法“Lchirpconnect/SDK

我正在使用Chirp Android SDK通过声音共享数据,它工作得很好。

但是当我启用我的proguard然后这个JNI exeption抛出,我尝试了很多方法来克服这个问题,比如在 proguard 文件中添加proguard 规则让我们看看:

-保持类io.chirp.connect.Chirpconnect { *; }

-保持类chirpconnect.chirpconnect { *; }

-keepclasseswithmembernames class * { 本机方法;}

但是没有找到任何解决方案?

我刚刚在libs文件夹中添加了一个 chirp SDK AAR并添加了这个

repositories {
    flatDir {
        dirs 'libs'
    }
}
Run Code Online (Sandbox Code Playgroud)

build.gradle文件

java-native-interface android proguard android-ndk chirp

6
推荐指数
0
解决办法
3916
查看次数

Android:您的设备与此版本不兼容

在此输入图像描述

目前我的应用程序已上传到Play商店,Android kitkat(4.4)设备与我的应用程序安装不兼容,我的app min目标API为16,我附图也

<uses-sdk
    android:minSdkVersion="16"
    android:targetSdkVersion="21" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature
    android:name="android.hardware.camera"
    android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<permission
    android:name="com.demo.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

<uses-permission android:name=".permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application
    android:name="Application"
    android:allowBackup="true"
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:theme="@style/AppTheme" >
    <activity
        android:name="SplashActivity"
        android:label="@string/app_name"
        >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".help.HelpActivity"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".help.Disclaimer"
        android:screenOrientation="portrait" >
    </activity>
Run Code Online (Sandbox Code Playgroud)

我该怎么办?

android

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

在通知频道中启用声音按钮

具有Oreo的最新MI UI 10.0的MI Note 5 Pro中,默认情况下,当我尝试发送推送通知时声音被禁用,因此当我为此创建通道时,无法以编程方式启用声音

在其他Oreo设备中,将发出通知声音,但在MI自定义Oreo OS中,声音默认为禁用

让我显示我的通知代码

    var intent = Intent(mContext, HomeActivity::class.java)
    intent.putExtra(Constants.EXTRA_FROM_NOTIFICATION, true)
    var pendingIntent = PendingIntent.getActivity(mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)

    var uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)

    var mBuilder = NotificationCompat.Builder(mContext, NOTIFICATION_CHANNEL_ID)
            .setContentTitle(mContext.getString(R.string.app_name))
            .setContentText(mFirstContactName + " : " + mListChatWindow[0].message)
            .setPriority(if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) NotificationManager.IMPORTANCE_HIGH else Notification.PRIORITY_HIGH)
            .setContentIntent(pendingIntent)
            .setSound(uri)
            .setSmallIcon(R.drawable.ic_app_icon)
            .setColor(ContextCompat.getColor(mContext, R.color.colorPrimary))
            .setVibrate(longArrayOf(0, 100, 1000, 300))
            .setAutoCancel(true)

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        var channel = NotificationChannel(NOTIFICATION_CHANNEL_ID, …
Run Code Online (Sandbox Code Playgroud)

notifications android mi

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

无法在HttpLoggingInterceptor Retrofit2.0上解析setLevel

我正在使用Retrofit并且我想记录我的响应和其他事情,我正在使用这个https://futurestud.io/tutorials/retrofit-2-log-requests-and-responses类型但我面临Cant解决setLevel错误

HttpLoggingInterceptor logging = new HttpLoggingInterceptor();  

logging.setLevel(Level.BODY); // i am getting error on this

OkHttpClient.Builder httpClient = new OkHttpClient.Builder();  

httpClient.addInterceptor(logging); //this is also getting error
Run Code Online (Sandbox Code Playgroud)

我正在使用这个 编译'com.squareup.okhttp3:logging-interceptor:3.3.1'和Retrofit 编译'com.squareup.retrofit2:converter-gson:2.1.0'依赖.

这是我得到错误的地方

android retrofit2 okhttp3

4
推荐指数
3
解决办法
5096
查看次数

ContentLoadingProgressBar 中的默认颜色更改

我在我的项目中使用androidx,我在某处使用ContentLoadingProgressBar,但我无法更改默认颜色。

我试过android:indeterminateTint无能为力

如果有人对此有任何想法,请建议

<androidx.core.widget.ContentLoadingProgressBar
                android:id="@+id/progress"
                android:layout_width="@dimen/_30sdp"
                android:layout_height="@dimen/_30sdp"
                android:indeterminateTint="@android:color/white"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
Run Code Online (Sandbox Code Playgroud)

android progress-bar androidx

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

Kotlin:创建扩展函数文件?plus

我在Kotlin开发一些lib ,我找不到这个解决方案,

在此输入图像描述

我怎么能解决这个问题,它说创建扩展函数File?.plus,在java中它的工作正常但在Kotlin中如何编写这段代码?

先感谢您.

android file kotlin kotlin-extension

-2
推荐指数
2
解决办法
570
查看次数