создать пользовательский фрагмент и задать ему некоторое название:Названия в FragmentDialog не может отображаться полностью
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
getDialog().setTitle(R.string.personalAuthDialogMessage);
getDialog().setCanceledOnTouchOutside(false);
View v = inflater.inflate(R.layout.personal_pass_dialog, null);
personalPasswordEditText = (EditText) v.findViewById(R.id.personalPasswordEditText);
buttonPositive = (Button) v.findViewById(R.id.personAuthButtonPositive);
buttonNegative = (Button) v.findViewById(R.id.personAuthButtonNegative);
buttonPositive.setOnClickListener(this);
buttonNegative.setOnClickListener(this);
return v;
}
Когда я вызываю его в своей деятельности все в порядке, за исключением размера заголовка не помещается на экран. Это выглядит так:
Оригинальное сообщение: «Пожалуйста, подтвердите свой пароль».
UPD. Код макета:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:id="@+id/personalDialogLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:inputType="textPassword"
android:id="@+id/personalPasswordEditText"
android:layout_gravity="center"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="match_parent"
android:layout_height="80dip"
android:text="@string/confirmOk"
android:id="@+id/personAuthButtonPositive" android:layout_weight="1"/>
<Button
android:layout_width="match_parent"
android:layout_height="80dip"
android:text="@string/confirmCancel"
android:id="@+id/personAuthButtonNegative" android:layout_weight="1"/>
</LinearLayout>
Показать код макета, который вы накачивания в вашем диалоге. – GrIsHu