gpt4 book ai didi

android - 无法使用 android-times-square v1.3.0 在 Android Studio 0.8.6 中呈现布局

转载 作者:行者123 更新时间:2023-11-30 02:41:03 26 4
gpt4 key购买 nike

我正在为日历选择器插件 android-times-square 的 Android Studio 中的嵌入式渲染器而苦苦挣扎。

https://github.com/square/android-times-square

我的布局声明:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.squareup.timessquare.CalendarPickerView
android:id="@+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingBottom="16dp"
android:scrollbarStyle="outsideOverlay"
android:clipToPadding="false"
android:background="#FFFFFF"
/>

IDE 显示的相关异常堆栈跟踪:

java.lang.IllegalArgumentException: Illegal pattern character 'L'
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:845)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:659)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:585)
at com.squareup.timessquare.CalendarPickerView.<init>(CalendarPickerView.java:121)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

现在,我知道从 API 版本 9 开始有效字符模式发生了变化(添加了“L”和“C”),但我的 SDK 由 build.gradle 按以下方式管理:

apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"

defaultConfig {
minSdkVersion 10
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'joda-time:joda-time:2.3'
compile 'com.squareup.retrofit:retrofit:1.5.1'
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.squareup:android-times-square:1.3.0@aar'
}

因此,使用麻烦的“L”解决正确的版本和 SDK 源应该没有任何问题。这是预览设置的屏幕截图:

http://i.imgur.com/aqauFHq.jpg?1

非常感谢任何帮助。

最佳答案

目前这是预览渲染器使用的布局库中的一个错误——它正在调用 JDK 版本的 SimpleDateFormat 类而不是 Android 版本。您可以看出这一点,因为 Android 版本根本没有 compile() 方法。

您可以在

跟踪错误

https://code.google.com/p/android/issues/detail?id=75940

关于android - 无法使用 android-times-square v1.3.0 在 Android Studio 0.8.6 中呈现布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25746097/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com