android - 渲染问题缺少样式

标签 android xml android-layout android-studio

Missing styles. Is the correct theme chosen for this layout? Use the Theme combobox above the layout to choose a different layout, or fix the theme style references. Potential trying to resolve '?attr/textColorHighlight': cyclic resource definitions? Render may not be accurate. (16 similar errors not shown) Failed to find '?attr/textColorHighlight' in current theme. (16 similar errors not shown) The graphics preview in the layout editor may not be accurate: - Paint.setShadowLayer is not supported. (Ignore for this session)

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical" android:layout_width="match_parent"
 android:layout_height="match_parent"
 >
  <RelativeLayout
    android:id="@+id/qwe"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:background="#34b233"
    android:orientation="horizontal">

    <Button
        android:id="@+id/buttonmnu"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        android:layout_marginRight="5dp"
        android:layout_centerVertical="true"
        android:background="@drawable/homeicon" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="Contact Exhibitor"
        android:textColor="#fff"

        android:textSize="7pt" />
</RelativeLayout>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"

    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/buttons"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="10dp"

        android:gravity="center"
        android:orientation="vertical">

        <Button
            android:id="@+id/buttonsubmit"
            android:layout_width="150dp"
            android:layout_height="40dp"
            android:layout_centerHorizontal="true"
            android:layout_gravity="center_horizontal"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="5dp"
            android:background="@drawable/button_round"
            android:text="Submit"

            android:textColor="#fff"
            android:textSize="5pt"


            />


    </LinearLayout>


    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/buttons"

        android:layout_marginBottom="10dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="40dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="15dp"
            android:orientation="vertical">

            <android.support.design.widget.TextInputLayout
                android:id="@+id/text1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="5dp"
                android:divider="#535353"
                android:theme="@style/TextLabel">

                <EditText
                    android:id="@+id/editText1"
                    android:layout_width="match_parent"
                    android:layout_height="30dp"
                    android:layout_centerHorizontal="true"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:gravity="left"
                    android:hint="Name*"
                    android:maxLength="50"
                    android:textColor="#000"
                    android:textSize="7pt"

                    />

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="#535353" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/text2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="5dp"
                android:divider="#535353"
                android:theme="@style/TextLabel">

                <EditText
                    android:id="@+id/editText2"
                    android:layout_width="match_parent"
                    android:layout_height="30dp"
                    android:layout_centerHorizontal="true"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:gravity="left"
                    android:hint="Designation*"
                    android:textColor="#000"
                    android:textSize="7pt"

                    />

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="#535353" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/text3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="5dp"
                android:divider="#535353"
                android:theme="@style/TextLabel">

                <EditText
                    android:id="@+id/editText3"
                    android:layout_width="match_parent"
                    android:layout_height="30dp"
                    android:layout_centerHorizontal="true"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:gravity="left"
                    android:hint="Company Name*"
                    android:maxLength="30"
                    android:textColor="#000"
                    android:textSize="7pt"

                    />

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="#535353" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/text4"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="5dp"
                android:divider="#535353"
                android:theme="@style/TextLabel">

                <EditText
                    android:id="@+id/editText4"
                    android:layout_width="match_parent"
                    android:layout_height="30dp"
                    android:layout_centerHorizontal="true"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:gravity="left"
                    android:hint="Phone Number*"
                    android:inputType="number"
                    android:textColor="#000"
                    android:textSize="7pt"

                    />

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="#535353" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/text5"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="5dp"
                android:divider="#535353"
                android:theme="@style/TextLabel">

                <EditText
                    android:id="@+id/editText5"
                    android:layout_width="match_parent"
                    android:layout_height="30dp"
                    android:layout_centerHorizontal="true"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:gravity="left"
                    android:hint="E-mail address*"
                    android:textColor="#000"
                    android:textSize="7pt"

                    />

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="#535353" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/text6"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="5dp"
                android:divider="#535353"
                android:theme="@style/TextLabel">

                <EditText
                    android:id="@+id/editText6"
                    android:layout_width="match_parent"
                    android:layout_height="30dp"
                    android:layout_centerHorizontal="true"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:gravity="left"
                    android:hint="Main activity of your company*"
                    android:textColor="#000"
                    android:textSize="7pt"

                    />

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="#535353" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/text10"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="5dp"
                android:divider="#535353"
                android:theme="@style/TextLabel">

                <EditText
                    android:id="@+id/edit10"
                    android:layout_width="match_parent"
                    android:layout_height="30dp"
                    android:layout_centerHorizontal="true"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:gravity="left"

                    android:hint="P.O.Box*"
                    android:textColor="#000"
                    android:textSize="7pt"

                    />

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="#535353" />
            </android.support.design.widget.TextInputLayout>



            <android.support.design.widget.TextInputLayout
                android:id="@+id/text12"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="10dp"

                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:divider="#535353"
                android:theme="@style/TextLabel">

                <EditText
                    android:id="@+id/edit12"
                    android:layout_width="match_parent"
                    android:layout_height="30dp"
                    android:layout_centerHorizontal="true"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:gravity="left"

                    android:hint="City"
                    android:textColor="#000"
                    android:textSize="7pt"

                    />

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="#535353" />
            </android.support.design.widget.TextInputLayout>
            <TextView
                android:id="@+id/text11"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="4dp"
                android:layout_marginTop="25dp"
                android:text="Country*"

                android:textColor="#000"
                android:textSize="6pt" />

            <Spinner
                android:id="@+id/edit11"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_marginLeft="10dp"
                android:entries="@array/country_arrays"
                android:gravity="center"
                android:popupBackground="#fff"
                android:spinnerMode="dropdown"
                android:textSize="6pt"

                />

            <TextView
                android:id="@+id/text7"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignLeft="@+id/text2"
                android:layout_alignParentTop="true"

                android:layout_marginLeft="4dp"
                android:layout_marginTop="25dp"
                android:text="Sector1"
                android:textColor="#000"
                android:textSize="6pt" />

            <Spinner
                android:id="@+id/spinner1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_marginLeft="10dp"

                android:gravity="center"
                android:popupBackground="#fff"
                android:prompt="@string/spinner1"
                android:spinnerMode="dropdown"
                android:textSize="7pt"
                android:theme="@style/TextAppearanceSpinnerItem"


                />

            <TextView
                android:id="@+id/text8"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignLeft="@+id/text2"
                android:layout_alignParentTop="true"

                android:layout_marginLeft="4dp"
                android:layout_marginTop="25dp"
                android:text="Exhibitor1"
                android:textColor="#000"
                android:textSize="6pt" />

            <Spinner
                android:id="@+id/spinnerExhibitor1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/text4"
                android:layout_centerHorizontal="true"
                android:layout_marginLeft="10dp"
                android:gravity="center"
                android:popupBackground="#fff"
                android:prompt="@string/spinner1"
                android:spinnerMode="dropdown"
                android:textColor="#000"
                android:textSize="7pt"

                android:theme="@style/TextAppearanceSpinnerItem" />

            <TextView
                android:id="@+id/text00"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignLeft="@+id/text2"
                android:layout_alignParentTop="true"

                android:layout_marginLeft="4dp"
                android:layout_marginTop="25dp"
                android:text="Sector2"
                android:textColor="#000"
                android:textSize="6pt" />

            <Spinner
                android:id="@+id/spinner2"
                android:layout_width="match_parent"

                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_marginLeft="10dp"
                android:entries="@array/About_arrays"
                android:gravity="center"
                android:popupBackground="#fff"
                android:prompt="@string/spinner1"
                android:spinnerMode="dropdown"
                android:textSize="7pt"
                android:theme="@style/TextAppearanceSpinnerItem" />


            <TextView
                android:id="@+id/text9"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignLeft="@+id/text2"
                android:layout_alignParentTop="true"

                android:layout_marginLeft="4dp"
                android:layout_marginTop="25dp"
                android:text="Exhibitor2"
                android:textColor="#000"
                android:textSize="6pt" />

            <Spinner
                android:id="@+id/spinnerExhibitor2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/text4"
                android:layout_centerHorizontal="true"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="10dp"
                android:entries="@array/About_arrays"
                android:gravity="center"
                android:popupBackground="#fff"
                android:prompt="@string/spinner1"
                android:spinnerMode="dropdown"
                android:textColor="#000"
                android:textSize="7pt"
                android:theme="@style/TextAppearanceSpinnerItem" />

        </LinearLayout>

    </ScrollView>

    </RelativeLayout>

这是 styles.xml 的相关部分:

  <resources>

  <!-- Base application theme. -->
  <style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->

    <item name="colorPrimary">@color/colorPrimary</item>
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
  </style>
<style name="AppTheme.AppBarOverlay"   parent="Base.ThemeOverlay.AppCompat.Dark.ActionBar">
    <item       name="android:textColorPrimary">@color/caldroid_lighter_gray</item>
     <item name="android:textColorSecondary">@color/colorAccent</item>
  </style>
  <style name="AppTheme.PopupOverlay"  parent="Base.ThemeOverlay.AppCompat.Light">
    <item name="android:colorBackground">@color/colorAccent</item>
    <item name="android:textColor">@color/colorAccent</item>
   </style>
   <style name="TextLabel" parent="Base.TextAppearance.AppCompat">
    <!-- Hint color and label color in FALSE state -->
    <item name="android:textColorHint">#535353</item>
    <item name="android:textSize">7pt</item>
    <!-- Label color in TRUE state and bar color FALSE and TRUE State -->
    <item name="colorAccent">#535353</item>
    <item name="colorControlNormal">#535353</item>
    <item name="colorControlActivated">#535353</item>
  </style>
  <style name="TextAppearanceSpinnerItem"   parent="android:TextAppearance.Widget.TextView.SpinnerItem">
    <item name="android:textColor">#000</item>
   </style>
    <style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
 </style>

  <style name="MyEditTextTheme">
    <!-- Used for the bottom line when not selected / focused -->
    <item name="colorControlNormal">#d4d4d4</item>
    <!-- colorControlActivated & colorControlHighlight use the colorAccent      color by default -->
 </style>



  </resources>

这是错误:

enter image description here

这是 build.gradle(module: app) 文件

   apply plugin: 'com.android.application'
   apply plugin: 'realm-android'



    android {
    compileSdkVersion 23
   buildToolsVersion "23.0.3"

   defaultConfig {
    applicationId "com.project.evizon.wetex2016"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"

  }
  buildTypes {
    release {
        minifyEnabled false


        proguardFiles getDefaultProguardFile('proguard-android.txt'),        'proguard-rules.pro'
    }
     }
    }

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile files('libs/joda-time-2.0.jar')
compile files('libs/ksoap2-android-assembly-2.5.8-jar-with-  dependencies.jar')       
compile files('libs/joda-time-2.4.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')

compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.afollestad:sectioned-recyclerview:0.2.2'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.16'
compile 'com.android.support:design:23.4.0'
compile 'dev.dworks.libs:astickyheader:0.1.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.2@aar'
compile 'com.roomorama:caldroid:3.0.1'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
    compile 'com.github.barteksc:android-pdf-viewer:1.3.0'
  compile "com.squareup.picasso:picasso:2.4.0"




  }

这里是build.gradle(project)

    buildscript {
  repositories {
    jcenter()
    maven { url "https://jitpack.io" }



  }


dependencies {
    classpath 'com.android.tools.build:gradle:2.1.0'
    classpath "io.realm:realm-gradle-plugin:1.0.1"


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
  }
 }

 allprojects {
repositories {
    jcenter()
  }
  }

task clean(type: Delete) {
delete rootProject.buildDir
  }

最佳答案

这肯定有效...... 使用

style = "@style/TextLabel"

在你的 TextViews 中......而不是

android:theme="@style/TextLabel"

这一定是 android 中的一个错误,因为“android:theme: 仅在您尝试运行您的程序之前有效……然后各种神秘的错误又回来了。

关于android - 渲染问题缺少样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38888733/

相关文章:

android - chris Jenx for Android Q 的书法库崩溃

android - 使用 Android Studio 处理 Eclipse 项目

xml - 在哪里声明一个 simpleType 以便它可以在同一个 XSD 中的多个元素中使用?

android - 如何在首选项 fragment 中创建登录表单

java - RelativeLayout 中的 ImageView 与父级不匹配

android - 如何在 Android ArCore Sceneform API 中的对象上设置重复纹理?

android - 更新Android Studio 4.1后,代码显示为白色

XmlSchema 空白崩溃 : What happens to multiple whitespaces?

xml - Ant/XML 转义属性值中的独立引号

android - 使布局在android中处于非 Activity 状态