UIPickerView 3 columns

0

I want to do a uipickerview with three columns, but only the first appears loaded other empty, I can not find the error if someone knows how to solve thank you. Here is the code:

staticstring[]nomesPeso=newstring[]{"Back Squat",
            "Front Squat",
            "OHS - Overhead Squat"
        };

static string[] nomesUnidades = new string[]
        {
            "Reps",
            "Kgs",
            "Lbs",
            "Metros"
        };

static string[] nomesRepeticoes = new string[]
        {
            "1 RM",
            "2 RM",
            "3 RM"
        };

public override nint GetComponentCount(UIPickerView v)
        {
            return 3;
        }

        public override nint GetRowsInComponent(UIPickerView pickerView, nint component)
        {
            switch (component)
            {
                case 0:
                    return nomesPeso.Length;
                case 1:
                    return nomesRepeticoes.Length; 
                case 2:
                    return nomesUnidades.Length;
                default:
                    throw new NotImplementedException();
            }
        }

        public override string GetTitle(UIPickerView picker, nint row, nint component)
        {
            switch (component)
            {
                case 0:
                    return nomesPeso[row];
                case 1:
                    return nomesRepeticoes[row]; 
                case 2:
                    return nomesUnidades[row];
                default:
                    throw new NotImplementedException();
            }
        }
    
asked by anonymous 04.04.2016 / 18:21

1 answer

0

They are not empty, it is the width of the first column that is too large. You can use the pickerView:widthForComponent: method to adjust the width. Documentation: link

    
12.05.2016 / 20:41