GridLayout – inconsistent vertical / horizontal constraints
                                        
                    •
                    Android                                    
                I publish this information because I can't find the exact information in the so and the rest of the network. I read this, but I'm not sure how to solve the problem
When I use GridLayout in my application, I have a problem. Whenever I rotate the screen, I will see output similar to the following:
In landscape mode:
06-23 21:41:25.627 10222-10222/in.cryf.yaca D/android.widget.GridLayout: vertical constraints: y1-y0>=112, y2-y1>=112, y3-y2>=112, y4-y3>=112, y4-y0<=311 are inconsistent; permanently removing: y4-y0<=311.
In portrait mode:
06-23 21:41:28.124 10222-10222/in.cryf.yaca D/android.widget.GridLayout: horizontal constraints: x1-x0>=192, x2-x1>=192, x3-x2>=192, x4-x3>=192, x4-x0<=704 are inconsistent; permanently removing: x4-x0<=704.
Although it will not affect the operation of my application, it may have performance problems from the so link published above
GridLayout in my XML:
<GridLayout
        android:id="@+id/button_grid"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
</GridLayout>
In addition, when I create my application, I programmatically add views to the layout
resolvent:
After the GridLayout is encapsulated in the Scrollview, the message no longer appears
<ScrollView
        android:layout_below="@id/output"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    <horizontalscrollview
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <GridLayout
            android:id="@+id/button_grid"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
        </GridLayout >
    </horizontalscrollview>
</ScrollView>
                
                            The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
                        
                                            
                        THE END
                    
                    
                    
                                                        二维码
                        
                        
                                                
                        