N.B. For the drop down, if I try to edit via a custom editor, and use spinner, I cannot use SetTextColor, only setbackgroundcolor
protected override void OnEditorCreated(DataFormItem dataFormItem, View editor)
{
if (dataFormItem.Name.Equals("EmailType"))
{
(editor as Spinner).SetTextColor(GlobalVar.GNightDayColorInv);
}
base.OnEditorCreated(dataFormItem, editor);
}
|
// Editing Spinner style
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="16dp"
android:textColor="@android:color/holo_green_dark"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" />
|
|
protected override void OnEditorCreated(DataFormItem dataFormItem, View editor)
{
if (dataFormItem.Name.Equals(""))
{
var dropDownItem = dataFormItem as DataFormDropDownItem;
var spinner = editor as Spinner;
spinner.Adapter = new ArrayAdapter(
this.DataForm.Context,
Resource.Layout.Spinner_item,
dropDownItem.ItemsSource);
}
base.OnEditorCreated(dataFormItem, editor);
}
|
Hi, the color is working great! Thank you! There is only two missing item:
- I need to be able to change the color the lines under the numeric / text fields, so the user know exactly where are the fields
- Additionally, I need to change the background color of the dropdown list when dropdown is selected
Thank you in advance!
Nicolas
|
Queries |
Details | ||
|
I need to be able to change the color the lines under the numeric / text fields, so the user know exactly where are the fields |
You can change the lines under the numeric or text field by setting BackgroundTintList for editor.
| ||
|
Additionally, I need to change the background color of the dropdown list when dropdown is selected |
You can change the background color of drop down list by setting Background color for SelectedView in custom renderer.
You can change the drop down list background color by editing spinner style.
|
That's great!!! Thank you! Great support as always
Nicolas