小编Sac*_*rma的帖子

Flutter更改FloatingActionButton的子图标颜色

我是Flutter的新手,并试图改变FloatingActionButton的子图标颜色.儿童图标颜色默认为白色.

我该怎么改变?

以下是我所使用的代码.

floatingActionButton: new FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: new Icon(Icons.add),
        backgroundColor: Colors.yellow,

      ), // This trailing comma makes auto-formatting nicer for build methods.
    ); 
Run Code Online (Sandbox Code Playgroud)

谢谢.

dart flutter

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

使用Intent将文本分享到Linkedin

我正在尝试使用Intent在LinkedIn中共享文本,我搜索了很多并使用了很多代码,但没有工作......我也看到了很多讨论,但是找不到合适的答案.

如何通过点击按钮打开LinkedIn以分享内容.我已经使用了以下代码,

    if(Utils.doesPackageExist(getSherlockActivity(), "com.linkedin.android"))
{           
    Intent shareIntent = new Intent(Intent.ACTION_SEND);
    shareIntent.setClassName("com.linkedin.android",
            "com.linkedin.android.home.UpdateStatusActivity"); 
    shareIntent.setType("text/*");
    shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareText);           
    startActivity(shareIntent);
}
else
{
    Toast.makeText(getSherlockActivity(), "Please install the LinkedIn app to share your result", Toast.LENGTH_LONG).show();
}
Run Code Online (Sandbox Code Playgroud)

然后

Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setClassName("com.linkedin.android",
        "com.linkedin.android.infra.deeplink.DeepLinkHelperActivity"); 
shareIntent.setType("text/*");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareText);           
startActivity(shareIntent);
Run Code Online (Sandbox Code Playgroud)

还有一些,但没有工作.

提前致谢.

android linkedin android-intent

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

Kotlin 中的数组声明

下面的代码是 Kotlin 中数组声明的示例,

fun main(args: Array<String>) {

    var a = Array<Int>(2){0}
    a[0] = 100
    a[1] = 200
    print(a[1])

}
Run Code Online (Sandbox Code Playgroud)

这里变量a是一个大小为 2 的数组,值为 100 和 200 ,它将a[1]的值打印为200

我的问题是 -> var a = Array(2){0} 中“0”的作用是什么

我将“0”的值更改为其他一些整数值,它仍然工作正常,但我无法找到它的用例。谁能解释一下?

任何帮助将不胜感激。

谢谢。

arrays kotlin

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

标签 统计

android ×1

android-intent ×1

arrays ×1

dart ×1

flutter ×1

kotlin ×1

linkedin ×1