I'm working on an Android app that has a form creator built in. I have an add- numberPicker option. The NumberPicker
is added to a TableRow View, which is added to a TableLayout view. I want the NumberPicker
to line up with the EditText
next to it but the padding on the top and the bottom offsets it. The Button
is added programmatically with this code:
// Add number chooser
NumberPicker numberChooser = new NumberPicker(this);
numberChooser.setId(id);
numberChooser.setBackgroundColor(Color.BLACK);
numberChooser.setPadding(0, 0, 0, 0);
numberChooser.setOrientation(LinearLayout.VERTICAL);
numberChooser.setEnabled(false);
tableRow.addView(numberChooser);
Here is the image of the result: (the element has a black background, I want to crop of the black strips above and below the blue lines)