3
Проверено на HTC One V андроида 4.0.3EditText сообщение об ошибке отображается неправильно
Активность:
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.widget.EditText;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
EditText editText = (EditText) findViewById(R.id.editText);
editText.setError("Error msg");
}
}
Xml:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_gravity="bottom"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</FrameLayout>
шаги:
Ожидаемое поведение: сообщение об ошибке отображается в правильном положении. Кто-нибудь знает, как это исправить? Спасибо!
Вот ваш показать код ошибки. xml не имеет этого, Поучите свой Java-код. –
done ............ – Sinigami
попробуйте добавить 'android: windowSoftInputMode =" adjustResize "' в вашу активность в файле манифеста –