Пожалуйста, поместите код ниже для пробела между строкой EditText и текстом. Это работает для меня.
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/edtFName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:drawablePadding="18dp"
android:gravity="center_vertical"
android:hint="@string/hint_username"
android:imeOptions="actionNext"
android:inputType="text"
android:maxLines="1"
android:paddingBottom="30dp"
android:singleLine="true"
android:textCursorDrawable="@null"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textHeadSignup" />
Обратите внимание: в WinForms вы можете вносить программные изменения в файл app.config до загрузки приложения (до Application.Start (new Form1 ())
), если вы используете System.Xml
вместо System.Configuration.ConfigurationManager
string configFile = Application.ExecutablePath + ".config"; //c:\path\exename.exe.config
XmlDocument xdoc = new XmlDocument();
xdoc.Load(configFile);
XmlNode node = xdoc.SelectSingleNode("/configuration/appSettings/add[@key='nodeToChange']/@value");
node.Value = "new value";
File.WriteAllText(setFile, xdoc.InnerXml);
На самом деле использование:
Application.restart ();
У меня неплохо сработало.
С уважением
Хорхе
Следующий хак, который вы можете применить, заставит конфиг читать с диска.
Вам просто нужно сохранить файл конфигурации в модифицированном режиме, а затем обновить его, чтобы приложение снова прочитало файл с диска.
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");