Uipickerview 3 columns

Asked

Viewed 37 times

0

I want to make a uipickerview with three columns, but only the first appears loaded the other empty, I can not find the error if someone knows how to solve thanks. Follow the code below:

inserir a descrição da imagem aqui

static string[] nomesPeso = new string[]
        {
            "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();
            }
        }

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.