3

意味のあるフルボーダーのカスタムerrorTextを作りたいです。EditText

editeText.setError(" ");

必須フィールドまたは検証フィールドであることを示すのに適した赤い境界線でエラーメッセージを表示します。

アイコンの違いだけのカスタマイズエラーメッセージを作成しました。

エラーメッセージのアイコンを変更するために使用されるスニップ:-

    final Drawable error_indicator;
    error_indicator = getResources().getDrawable(R.drawable.error_icon_mdpi);
    int left = 0;
    int top = 0;
    int right = error_indicator.getIntrinsicHeight();
    int bottom = error_indicator.getIntrinsicWidth();
    error_indicator.setBounds(new Rect(left, top, right, bottom));
    addSxName.setError("Enter patient name in here", error_indicator);

これがその外観です。

私が得たもの

私が探しているもの: -

私が探しているもの

しかし、ツールチップまたはその赤い枠線が少し目を引くものとして。

その errorBox の変更を変更できますか?

4

1 に答える 1

2

不可能です

代替ソリューション

  1. setError() を使用しないでください
  2. カスタム ポップアップ ウィンドウを作成する
  3. 独自の set error メソッドを作成し、そこにポップアップ ウィンドウを表示します。
于 2014-01-13T08:20:55.623 に答える