android-layout-editor

How to refresh preview on Android Studio 2.2?

╄→尐↘猪︶ㄣ 提交于 2019-12-18 11:15:47
问题 Now on Android Studio 2.2 on new Preview mode, there are no more refresh button : Image 1: Preview on Android Studio 2.2 (without refresh button) Image 2: Preview on Android Studio 2.1 (with refresh button) Does anyone know how to display it again? Or with shortcut maybe? Edit: If I change a drawable by example and that the change does not appear in the layout, the only method that works for me is closed and restart the project. If I close the layout and as I re-opens nothing happens. Same

Error: “The graphics preview in the layout editor may not be accurate: Paint.setShadowLayer is not supported”

ぃ、小莉子 提交于 2019-12-18 05:29:04
问题 I'm using Eclipse and I just created a home page (menu) with 2 image buttons, but I am getting this error: The graphics preview in the layout editor may not be accurate: Paint.setShadowLayer is not supported. What does it mean? And how can I solve it? I am using API 21. 回答1: It means the preview doesn't know how to implement setShadowLayer. This means the preview won't look exactly like the result rendered on the device. Which is one of many reasons why you shouldn't trust the preview app-

Showing right layout in the editor for Custom Views in Android studio

情到浓时终转凉″ 提交于 2019-12-10 09:36:04
问题 I'm experiencing a strange behavior of the layout preview in Android Studio. I've developed a custom view extending an AppCompatButton and the layout is the expected one at runtime, however, the layout in the layout preview is not displaying correctly. In particular, the button is displayed but without the background color set from the custom attribute and without the drawableStart (set in the custom view init according to a custom attribute named "social"). See the code below for additional

Showing right layout in the editor for Custom Views in Android studio

眉间皱痕 提交于 2019-12-05 18:16:39
I'm experiencing a strange behavior of the layout preview in Android Studio. I've developed a custom view extending an AppCompatButton and the layout is the expected one at runtime, however, the layout in the layout preview is not displaying correctly. In particular, the button is displayed but without the background color set from the custom attribute and without the drawableStart (set in the custom view init according to a custom attribute named "social"). See the code below for additional details. Please be aware that the custom view is inside a library that is imported in the main project

Error: “The graphics preview in the layout editor may not be accurate: Paint.setShadowLayer is not supported”

风格不统一 提交于 2019-11-29 09:10:00
I'm using Eclipse and I just created a home page (menu) with 2 image buttons, but I am getting this error: The graphics preview in the layout editor may not be accurate: Paint.setShadowLayer is not supported. What does it mean? And how can I solve it? I am using API 21. It means the preview doesn't know how to implement setShadowLayer. This means the preview won't look exactly like the result rendered on the device. Which is one of many reasons why you shouldn't trust the preview app- always test your layouts on a physical device before assuming they're done. In my case it was a new component,

Failed to find style 'coordinatorLayoutStyle' in current theme In Android Studio 3.1

匆匆过客 提交于 2019-11-27 08:54:49
The Android Studio 3.1 layout preview fails to find style 'coordinatorLayoutStyle' in the current theme. Failed to instantiated one or more classes. Exception shown are :- java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener Ashish Kumar This happened due to use of alpha version SDK 28 We need to change the android { ... } in "build.gradle" in app file compileSdkVersion 28 to compileSdkVersion 27 targetSdkVersion 28 to targetSdkVersion 27 Also, try to change implementations like implementation 'com.android.support:appcompat-v7:28.0.0-alpha3' to implementation 'com

Failed to find style 'coordinatorLayoutStyle' in current theme In Android Studio 3.1

淺唱寂寞╮ 提交于 2019-11-26 14:22:08
问题 The Android Studio 3.1 layout preview fails to find style 'coordinatorLayoutStyle' in the current theme. Failed to instantiated one or more classes. Exception shown are :- java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener 回答1: This happened due to use of alpha version SDK 28 We need to change the android { ... } in "build.gradle" in app file compileSdkVersion 28 to compileSdkVersion 27 targetSdkVersion 28 to targetSdkVersion 27 Also, try to change implementations