物理设备上的错误视图DialogFragment

时间:2017-05-26 04:19:59

标签: android dialog

我有一个问题,对话框片段的视图看起来很好,但它在物理设备上看起来很糟糕,我不明白它应该是什么。

DialogFragment错误

DialogFragment Error

预计

DialogFragment

DialogFragment Expected

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background_app"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="dialog_test_Fragment">

    <ImageView
        android:id="@+id/imageViewClose"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right|top"
        android:clickable="true"
        android:src="@drawable/ic_action_close" />

</RelativeLayout>

1 个答案:

答案 0 :(得分:2)

那必须是import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; public static String addContact() throws IOException { Path contactsPath = Paths.get(addressBook, contacts); List<String> people = Files.readAllLines(contactsPath); System.out.println("Add a new contact"); System.out.println("Enter Contacts Name"); String nameInput = in.nextLine(); //Define in to read user input System.out.println("Enter Contacts Number"); String phoneNumInput = in.nextLine(); String newContact = nameInput + " | " + phoneNumInput; if (people.contains(newContact)) { System.out.println("There's already a contact named "+nameInput+". Do you want to overwrite it? (Yes/No)"); String yesNoInput = in.nextLine(); if(yesNoInput.equalsIgnoreCase("yes") || yesNoInput.equalsIgnoreCase("y")){ Files.write( Paths.get(addressBook, contacts), newContact, StandardOpenOption.APPEND ); continueMenu(); } continueMenu(); } return nameInput; } 的标题 尝试删除它,

DialogFragment