小编jak*_*ang的帖子

is includePadding not recommended as PlatformTextStyle is deprecated in jetpack compose?

I'm developing with jetpack compose. When I use includePadding = false, in compose, the feature is used like below

platformStyle = PlatformTextStyle(includeFontPadding = false)
Run Code Online (Sandbox Code Playgroud)

But the jetpack compose docs say like below,

includeFontPadding was added to Android in order to prevent clipping issues on tall scripts. 
However that issue has been fixed since Android 28. 
Jetpack Compose backports the fix for Android versions prior to Android 28. 
Therefore the original reason why includeFontPadding was needed in invalid on Compose.
This …
Run Code Online (Sandbox Code Playgroud)

android android-jetpack-compose

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

为什么java中的stream::iterator有可能返回到Iterable?

我正在阅读《Effective Java》,有一个问题。我不明白为什么流迭代器返回到Iterable。据我所知,Iterable包含迭代器接口。但在流 api 中,即使迭代器不继承 Iterable,此代码也是有效的。

    public static <E> Iterable<E> iterableOf(Stream<E> stream){
        return stream::iterator;
    }
Run Code Online (Sandbox Code Playgroud)

我对这些代码感到非常困惑。因为Iterator和Iterable之间没有关系,只是Iterable有Iterator。

java

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

标签 统计

android ×1

android-jetpack-compose ×1

java ×1