John
John

Reputation: 73

No resource identifier found for attribute 'textcolor' in package 'android'

I am getting constant error in main_activity. Error:- No resource identifier found for attribute 'textcolor' in package 'android'

The code for main activity is this

    <?xml version="1.0" encoding="utf-8"?>
<linearlayout android:layout_height="fill_parent" 
              android:layout_width="fill_parent" 
              android:orientation="vertical" 
              xmlns:android="http://schemas.android.com/apk/res/android">

    <imageview android:id="@+id/imageView_pic" 
               android:layout_gravity="center" 
               android:layout_height="100dp" 
               android:layout_width="100dp">

    <button android:id="@+id/button_selectpic" 
            android:layout_height="wrap_content" 
            android:layout_width="match_parent" 
            android:text="Select Picture">

    </button><button android:id="@+id/uploadButton" 
                     android:layout_height="wrap_content" 
                     android:layout_width="fill_parent" 
                     android:text="Click To Upload File">

   <textview android:id="@+id/messageText" 
              android:layout_height="wrap_content" 
              android:layout_width="fill_parent" 
              android:text="" 
              android:textcolor="#000000" 
              android:textstyle="bold">


   </textview>





 </button>

 </imageview>

 </linearlayout>

Upvotes: 0

Views: 2716

Answers (3)

Alberto
Alberto

Reputation: 377

In addition to the answers given, you're closing a Button after a TextView. Se what blackbelt says about closing tags.

Upvotes: 3

Blackbelt
Blackbelt

Reputation: 157437

Android widget are camel cased, so

  1. imageview is ImageView
  2. textview is TextView

and so on. Also, elements that extends View, such Button, ImageView, TextView can not have children, so you have to close immediately the tag. For instance:

  <TextView android:id="@+id/messageText" 
              android:layout_height="wrap_content" 
              android:layout_width="fill_parent" 
              android:text="" 
              android:textcolor="#000000" 
              android:textstyle="bold" />

as correctly pointed out by @DoctorDrive also some attributes are camel-cased, so android:textcolor is android:textColor and android:textstyle="bold" is android:textStyle="bold"

Upvotes: 4

Phant&#244;maxx
Phant&#244;maxx

Reputation: 38098

It's textColor and textStyle instead of textcolor and textstyle

Upvotes: 3

Related Questions