如何Xamarin.Forms调整水平的ListView的大小

2025-04-09 05:19:13
推荐回答(1个)
回答1:


             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="ExampleProject.SomePage" >
    
        
                                  ItemsSource="{Binding ExampleList}"
                      RowHeight="120"
                      Rotation="270"
                      RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5, Constant=-60}"
                      RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=-0.5, Constant=60}"
                      RelativeLayout.WidthConstraint="{ConstraintExpression Type=Constant, Constant=120}"
                      RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
                      >
                
                    
                        
                            
                                                                       TranslationX="120" />
                            

                        

                    

                

            
                            RelativeLayout.XConstraint="{ConstraintExpression Type=Constant, Constant=0}"
                RelativeLayout.YConstraint="{ConstraintExpression Type=Constant, Constant=120}"
                RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
                RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1, Constant=-120}"
                >