Wix: Остановка службы Windows на удалении

Вот пользовательская реализация класса для ответа Аднеала .

public class CustomTextInputLayout extends TextInputLayout {

    public CustomTextInputLayout(Context context) {
        super(context);
        initFont(context);
    }

    public CustomTextInputLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        initFont(context);
    }

    private void initFont(Context context) {
        final Typeface typeface = Typeface.createFromAsset(
                context.getAssets(), "fonts/YOUR_CUSTOM_FONT.ttf");

        EditText editText = getEditText();
        if (editText != null) {
            editText.setTypeface(typeface);
        }
        try {
            // Retrieve the CollapsingTextHelper Field
            final Field cthf = TextInputLayout.class.getDeclaredField("mCollapsingTextHelper");
            cthf.setAccessible(true);

            // Retrieve an instance of CollapsingTextHelper and its TextPaint
            final Object cth = cthf.get(this);
            final Field tpf = cth.getClass().getDeclaredField("mTextPaint");
            tpf.setAccessible(true);

            // Apply your Typeface to the CollapsingTextHelper TextPaint
            ((TextPaint) tpf.get(cth)).setTypeface(typeface);
        } catch (Exception ignored) {
            // Nothing to do
        }
    }
}

В ваших XML-файлах теперь вам нужно использовать CustomTextInputLayout вместо TextInputLayout, и это будет работать из коробки.



    

Спасибо Adneal за ответ.

7
задан Jon Seigel 5 March 2010 в 19:08
поделиться

1 ответ

Вы уверены, что для свойства X_WIN_SERVICE_NAME задано правильное значение при удалении. Используйте файл подробного журнала, чтобы убедиться, что поиск устанавливает значение правильно. Все выглядит нормально (хотя я не знаю, почему вы помещаете все в файлы Include, а не просто используете фрагменты).

4
ответ дан 7 December 2019 в 14:37
поделиться
Другие вопросы по тегам:

Похожие вопросы: