Reputation: 35579
I have one custom class which extends View
class and in which i am just drawing some custom Bitmaps. Now problem is whenever i am using that class in xml, it creates rendering problem.
Here is my XML code :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.custom.DrawingView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
There is nothing else i am using in xml but still error is there, i am also sharing screenshot for it, check below.
In my custom View class i have used BlurMaskFilter also
BlurMaskFilter blurMaskFilter = new BlurMaskFilter(5,
BlurMaskFilter.Blur.NORMAL);
As you can see, i am not able to see preview of my layout and not even Component Tree.
Configuration :
Android studio : 2.1.3
classpath 'com.android.tools.build:gradle:2.1.3'
compileSdkVersion 24
buildToolsVersion "24.0.0"
Upvotes: 1
Views: 645
Reputation: 370
Set android:hardwareAccelerated="false"
on your activity inAndroidManifest.xml
like this:
<activity android:name=".MyActivity" android:hardwareAccelerated="false">
It works fine for me.
Upvotes: 0