Мой экран входа в систему не отображается в эмуляторе. Он отображается, так как Ваше приложение было остановлено. У меня есть XML-файл, расположение которого является идеальной позицией в форме дизайна. У меня есть login_screen.xml: пожалуйста, помогите мне.тот же xml-файл login_screen в моем эмуляторе. Я пытаюсь сделать LoginScreen в файле манифеста, а затем выдает ту же ошибку.
<?xml version="1.0" encoding="utf-8"?>
<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:orientation="vertical"
android:background="@color/black" >
<RelativeLayout
android:id="@+id/relMyHead"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="@drawable/loginimage">
<EditText
android:id="@+id/edt_userName"
android:layout_width="260dp"
android:layout_height="48dp"
android:layout_below="@+id/img_login_logo"
android:layout_centerInParent="true"
android:layout_marginLeft="6dp"
android:layout_marginTop="150dp"
android:drawableLeft="@drawable/envelope"
android:drawablePadding="14dp"
android:drawableStart="@drawable/envelope"
android:hint="@string/Email"
android:inputType="textEmailAddress"
android:padding="4dp"
android:singleLine="true"
android:textColor="@color/blue_500"
android:textColorHint="#BBBBBB">
<requestFocus />
</EditText>
<EditText
android:id="@+id/edt_password"
android:layout_width="260dp"
android:layout_height="48dp"
android:layout_alignLeft="@+id/edt_userName"
android:layout_below="@+id/edt_userName"
android:layout_marginRight="6dp"
android:layout_marginTop="10dp"
android:drawableLeft="@drawable/key"
android:drawablePadding="14dp"
android:hint="@string/password"
android:inputType="textPassword"
android:padding="4dp"
android:password="true"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="#BBBBBB" />
<Button
android:id="@+id/btn_Login"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignLeft="@+id/edt_password"
android:layout_alignRight="@+id/edt_password"
android:layout_below="@+id/edt_password"
android:layout_marginTop="20dp"
android:background="@drawable/loginimage"
android:gravity="center"
android:letterSpacing="0.1"
android:text="@string/btn_login"
android:textColor="@color/white"
android:textStyle="bold"
tools:foregroundTintMode="screen" />
<ImageView
android:id="@+id/img_login_logo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="100dp"
android:adjustViewBounds="true"
android:contentDescription="@string/app_name"
android:minHeight="500dp"
android:scaleType="fitCenter"
android:src="@drawable/csrlogo_2x" />
<LinearLayout
android:id="@+id/new_user_reg_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/btn_Login"
android:layout_marginTop="25dp"
android:gravity="center_horizontal"
android:longClickable="false">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:letterSpacing="0.1"
android:text="@string/not_member"
android:textColor="@color/barLightColor"
android:textSize="20sp" />
<TextView
android:id="@+id/register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:clickable="true"
android:letterSpacing="0.1"
android:textColor="@color/popup_text_color"
android:textSize="20sp" />
</LinearLayout>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/img_login_logo"
android:layout_centerHorizontal="true"
android:fontFamily="@font/roboto"
android:letterSpacing="0.2"
android:text="TRAVEL ASSIST"
android:textColor="@color/popup_text_color"
android:textSize="25sp"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
Журнал ошибок:
Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class <unknown>
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:393)
at android.app.Activity.setContentView(Activity.java:2166)
at com.example.developer.travelassistmobileapp.LoginScreen.onCreate(LoginScreen.java:51)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:694)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:762)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:393)
at android.app.Activity.setContentView(Activity.java:2166)
at com.example.developer.travelassistmobileapp.LoginScreen.onCreate(LoginScreen.java:51)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)