我有一个专为iPhone SE设计的ViewController
如你所见,我也有一个约束 Align Top to: Safe Area Equals 75
问题是,是否可以为iPhone 8和iPhone 8 Plus更改此值?例如:
我有一个清单 List<FileModel>
FileModel 只是一个类包含 id: Int
id - 是我需要获取并投射到位图的照片文件的 ID
我有个请求:
fun getFile(fileId: Int): Single<ResponseBody>
Run Code Online (Sandbox Code Playgroud)
此请求返回ResponseBody,我们可以将其转换为 Bitmap
和
fun generatePhoto(responseBody: ResponseBody): Single<Bitmap?>
Run Code Online (Sandbox Code Playgroud)
我想要的是创建一个函数
fun getPhotos(list: List<FileModel>): Single<List<Bitmap>> {
// Execute getFile(...) for each item in the list
// Cast getFile(...) result to Bitmap using generatePhoto(...)
// Return a list of Bitmaps
}
Run Code Online (Sandbox Code Playgroud)
我试过这样的事情,但这是完全错误的
fun getPhotos(list: List<FileModel>): Single<List<Bitmap>> {
return Observable.fromIterable(list)
.flatMap { getFile(it.id) }
// How to call generatePhoto(...) here?
}
Run Code Online (Sandbox Code Playgroud) 我有一个自定义按钮:
import QtQuick 2.0
Rectangle {
id: xobutton
width: 100
height: 100
property string label: "?"
border.width: 2
Text {
id: xobuttonLabel
text: label
font.pointSize: 75
anchors.centerIn: parent
}
}
Run Code Online (Sandbox Code Playgroud)
它有一个父级Rectangle:
Rectangle {
width: 500
height: 500
Grid {
anchors.centerIn: parent
rows: 3; columns: 3; spacing: 0
Repeater {
model: 9
Xobtn { }
}
}
}
Run Code Online (Sandbox Code Playgroud)
我需要为Gridparent中的所有可用空间拉伸所有按钮Rectangle。我怎样才能做到这一点?谢谢。
我有列表{"100","5","1","300","7"},当我stream().sorted()用于此列表时,它给了我以下结果{"1","100","300","5","7"}.看起来它只按第一个数字排序.怎么了?
ArrayList<String> list = new ArrayList<>(Arrays.asList(
"100","5","1","300","7"
));
list.stream().sorted().forEach(e -> System.out.println(e));
Run Code Online (Sandbox Code Playgroud) android ×1
ios ×1
java ×1
java-8 ×1
java-stream ×1
kotlin ×1
qml ×1
qt ×1
qtquick2 ×1
rx-android ×1
rx-java2 ×1
rx-kotlin ×1
size-classes ×1
xcode ×1