Can';使用Android时代广场v1.3.0在Android Studio 0.8.6中渲染布局
在Android Studio中,我正在努力使用Android时代广场的日历选择器插件的嵌入式渲染器 我的布局声明:Can';使用Android时代广场v1.3.0在Android Studio 0.8.6中渲染布局,android,android-layout,android-studio,Android,Android Layout,Android Studio,在Android Studio中,我正在努力使用Android时代广场的日历选择器插件的嵌入式渲染器 我的布局声明: <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" andr
<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"
/>
因此,用麻烦的“L”解决正确的版本和SDK源代码应该不会有任何问题。以下是预览设置的屏幕截图:
非常感谢您的帮助。目前,预览渲染器使用的布局库中存在一个bug——它调用的是JDK版本的
SimpleDataFormat
类,而不是Android版本。您可以这样说,因为Android版本根本没有compile()
方法
您可以在以下位置跟踪错误:
只是一个猜测。。难道这不是你在Android L版本中的预览吗?基本问题是布局预览使用的是JDK版本的SimpleDataFormat类,而不是Android版本的;Android版本根本没有
compile()
方法。让我调查一下。调查之后,是的,这是一个bug——现在我不能再添加更多了。我将我的评论提升为一个答案。是的,这是我最初的假设,引用了不正确的SimpleDataFormat。谢谢你的意见
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)
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'
}