How to change Picker font colour and size in Xamarin forms?

后端 未结 6 1723
梦如初夏
梦如初夏 2021-01-14 17:01

I\'m new to Xamarin and I\'m currently doing a project in Xamarin Forms PCL.

Is there a way to change the font colour and size of Picker?

  

6条回答
  •  猫巷女王i
    2021-01-14 18:01

    Font size of a picker can be changed with PCL code.

    Create MainPage.xaml file

    
            
                Option 1
                Option 2
                Option 3
            
        
        
    

    Create MainPage.xaml.cs file

    private void PickerList_SelectedIndexChanged(object sender, EventArgs e)
        {
            PickerLabel.Text = PickerList.Items[PickerList.SelectedIndex];
            // PickerLabel.Text = PickerList.SelectedItem.ToString() ;
        }
    
        private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
        {
            PickerList.Focus();
        }
    

    this solves the problem for Android and IOS.

提交回复
热议问题