我在ConstrainLayout中使用了GridLayout。只有1列和5行。
我在真实和虚拟设备中都能正常工作,但是XML / design视图中有错误消息。
消息:
渲染问题,视图绘制失败,请尝试刷新布局。
如何解决?
如果我删除GridLayout,错误消失了。
我尝试分别删除布局内的视图,但问题仍然存在。
来自xml:
<GridLayout
android:id="@+id/gridlyMiddle"
android:layout_width="0dp"
android:layout_height="0dp"
android:columnCount="1"
android:rowCount="5"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/guidelinev50"
app:layout_constraintRight_toLeftOf="@id/guidelinev60"
app:layout_constraintTop_toTopOf="parent">
来自gradle:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:gridlayout-v7:28.0.0'
implementation 'com.android.support:support-compat:28.0.0'
implementation 'com.daimajia.easing:library:2.0@aar'
implementation 'com.daimajia.androidanimations:library:2.3@aar'
}