我smoothScrollBy()
用来滚动到一个特定的位置ListView
.我希望在ListView
完成滚动时得到通知,将其与onScrollStateChanged()
当用户用手指滚动时触发的当前事件集成.
目前我使用的Timer
是在平滑滚动的持续时间之后运行100ms,但这不是我喜欢的事件驱动.
在完成所有这些步骤以查看Android源代码(Gingerbread分支)之后,为了解决编译错误,我决定尝试从不同的源代码获取源代码.
以下是我从GitHub.com存储库中检出源代码所采取的步骤.
我检查了GitHub.com存储库中的repo工具
git clone git://github.com/android/tools_repo.git
Run Code Online (Sandbox Code Playgroud)
在下载的repo脚本文件中,我更改了repo工具的位置,如下所示:
## repo default configuration
##
#REPO_URL='git://android.git.kernel.org/tools/repo.git'
REPO_URL='git://github.com/android/tools_repo.git'
REPO_REV='stable'
Run Code Online (Sandbox Code Playgroud)
在此之后,我使用repo脚本'git wrapper'为源代码创建了存储库.
repo init -u git://github.com/android/platform_manifest.git -b gingerbread
Run Code Online (Sandbox Code Playgroud)
这给了我一个成功的结果; "repo在/ home/my /目录中初始化"
但是,当我尝试时repo sync
,我收到以下错误消息:
$ repo sync
Initializing project platform/bionic ...
android.git.kernel.org[0: 149.20.4.77]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
error: Cannot fetch platform/bionic
Run Code Online (Sandbox Code Playgroud)
现在离线android.git.kernel.org的引用在哪里? cat repo|grep kernel.org
没有给我什么.
如果我有一个原始值数组,我如何在RealmResults的.where()上运行.not().contains()?
希望代码看起来像这样:
results.where().not().contains("id", new int[] {1, 2, 3})
Run Code Online (Sandbox Code Playgroud)
或者我是否必须迭代所有这些结果并将它们单独采集出来?
当我提示指纹对话框验证用户身份时,我在崩溃日志中看到了很多。
java.security.UnrecoverableKeyException: Failed to obtain information about key at
..my code..
io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.checkTerminated(ObservableObserveOn.java:287) at
io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:172) at
io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255) at
io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:119) at android.os.Handler.handleCallback(Handler.java:873) at
android.os.Handler.dispatchMessage(Handler.java:99) at
android.os.Looper.loop(Looper.java:214) at
android.app.ActivityThread.main(ActivityThread.java:6981) at
java.lang.reflect.Method.invoke(Native Method) at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
Caused by: java.security.UnrecoverableKeyException: Failed to obtain information about key at
android.security.keystore.AndroidKeyStoreProvider.getKeyCharacteristics(AndroidKeyStoreProvider.java:238) at
android.security.keystore.AndroidKeyStoreProvider.loadAndroidKeyStoreKeyFromKeystore(AndroidKeyStoreProvider.java:360) at
android.security.keystore.AndroidKeyStoreSpi.engineGetKey(AndroidKeyStoreSpi.java:116) at java.security.KeyStore.getKey(KeyStore.java:1062) at
Caused by: android.security.KeyStoreException: 112 at
android.security.KeyStore.getKeyStoreException(KeyStore.java:1147) at
android.security.keystore.AndroidKeyStoreProvider.getKeyCharacteristics(AndroidKeyStoreProvider.java:240) ... 34 more
Run Code Online (Sandbox Code Playgroud)
这是什么KeystoreException:112,这会导致什么?我正在尝试有机地重现该错误,但一直无法。
在对方法进行一些更改之后,我发现在方法调用之前必须手动重新计算Javadoc源注释是非常烦人的.有没有办法让Eclipse自动为您执行此操作?
我试图解决Gradle的一个烦人的问题,它不允许库有不同的最小/目标sdk.解决方案是将以下内容添加到build.gradle中.
android.applicationVariants.all{ variant ->
// This is an annoying hack to get around the fact that the Gradle plugin does not support
// having libraries with different minSdkVersions. Play Services has a min version of 9 (Gingerbread)
// but Android Maps Utils supports 8 (Froyo) still
variant.processManifest.doFirst {
File manifestFile = file("${buildDir}/exploded-bundles/ComGoogleMapsAndroidAndroidMapsUtils03.aar/AndroidManifest.xml")
if (manifestFile.exists()) {
println("Replacing minSdkVersion in Android Maps Utils")
String content = manifestFile.getText('UTF-8')
content = content.replaceAll(/minSdkVersion="8"/, 'minSdkVersion=\"9\"')
manifestFile.write(content, 'UTF-8')
println(content)
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我这样做时,我收到一个错误,即applicationVariants无法解析.我该如何解决?
原始邮政
我们最近将我们的应用程序转换为Swift 2.0和iOS9.我看到的一个奇怪问题是调用tableView.dequeueReusableCellWithIdentifier()会导致应用程序在模拟器中挂起.
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
//hangs on the line below
let headersection: HeaderSectionCell = tableView.dequeueReusableCellWithIdentifier("SectionHeader") as! HeaderSectionCell
...
return headersection
}
Run Code Online (Sandbox Code Playgroud)
标题单元格
class HeaderSectionCell: UITableViewCell {
@IBOutlet var labelOne: UITextView!
@IBOutlet var labelTwo: UITextView!
@IBOutlet var textView: UITextView!
}
Run Code Online (Sandbox Code Playgroud)
模拟器CPU使用率为100%
最后,我们的Swift调用dequeueReusableCellWithIdentifier()
这个特殊的悬挂实例来自函数tableView(tableView: UITableView, viewForHeaderInSection section: Int)
,但我们也挂在调用内部,tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath)
同样的问题.
我已经尝试过在故事板编辑器中使用单元格属性,但没有什么能与其他正常工作的视图有所不同.
编辑
在调用dequeReusableCellWithIdentifier()之下,Foundation和libobjc.A.dylib之间似乎存在无限循环.我最终确保在任何其他框架之前导入Foundation,并将违规的UITableViewCell抽象到自己的类中(正在被重用).有问题的原始呼叫现在正在运行,但还有另一个仍然在我正在努力解决的Swift封面下循环.
在无限循环中达到暂停会使我进入相同的汇编堆栈位置:
暂停后堆栈跟踪的顶部:
libobjc.A.dylib`objc_msgSend:
0x107f6a800 <+0>: testq %rdi, %rdi
0x107f6a803 <+3>: jle 0x107f6a850 ; …
Run Code Online (Sandbox Code Playgroud) 测试视图控制器时,如何在测试用例中模拟/存根navigationController?我收到一个运行时异常,因为在运行测试时,它在UIViewController中为零。您不能直接设置它,因为它是只读的。我正在使用Swift 2.2和XCTest。
我一直在运行我的Crystal webapp,通过构建它,然后运行可执行文件.但是,它总是侦听端口3000.
如何在80和443上构建/运行Crystal Web应用程序?
我也在使用凯末尔.这是我的示例应用程序.
require "kemal"
get "/" do
"Hello World!"
end
Kemal.run
Run Code Online (Sandbox Code Playgroud)
建造:
crystal build src/myapp.cr
Run Code Online (Sandbox Code Playgroud)
运行:
./myapp
Run Code Online (Sandbox Code Playgroud) android ×6
ios ×2
java ×2
swift ×2
contains ×1
crystal-lang ×1
eclipse ×1
event-driven ×1
git ×1
gradle ×1
ios9 ×1
javadoc ×1
kemal ×1
listview ×1
realm ×1
refactoring ×1
repository ×1
scroll ×1
swift2 ×1
uitableview ×1
xctest ×1