Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8907121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:49:44+00:00 2026-06-15T02:49:44+00:00

Here’s my problem. I’m currently setting up a relative Layout for a TicTacToe-Game. It

  • 0

Here’s my problem.

I’m currently setting up a relative Layout for a TicTacToe-Game.
It consists of 9 ImageButtons, and 8 Views which I use to get the grid.

Either I have errors in my xmlfile, saying “no ressource found”(even if id’s are correctly build into my r.class) or the errors disappear when I retype my layout referrences to other view. But if I retype it, clean project and build it again, eclipse lets my R.class disappear.

Here my XML-File:

    `<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/notepad2" >    

    <View 
    android:layout_width="5dp" 
    android:layout_height="160dp"
    android:background="#FF0000"
    android:layout_toLeftOf="@id/hor2"
    android:id="@+id/vert1"
    />

 <View 
    android:layout_width="5dp" 
    android:layout_height="160dp"
    android:background="#FF0000"
    android:layout_toLeftOf="@id/hor3"
    android:id="@+id/vert2"
    />

 <View 
    android:layout_width="50dp" 
    android:layout_height="5dp"
    android:background="#FF0000"

    android:layout_alignLeft="@id/feld4"
    android:layout_above="@id/feld4"
    android:id="@+id/hor1"
    />

 <View 
    android:layout_width="50dp" 
    android:layout_height="5dp"
    android:background="#FF0000"

    android:layout_alignLeft="@id/feld5"
    android:layout_above="@id/feld5"
    android:id="@+id/hor2"
    />



 <View 
    android:layout_width="50dp" 
    android:layout_height="5dp"
    android:background="#FF0000"

    android:layout_alignLeft="@id/feld6"
    android:layout_above="@id/feld6"
    android:id="@+id/hor3"
    />

  <View 
    android:layout_width="50dp" 
    android:layout_height="5dp"
    android:background="#FF0000"

    android:layout_alignLeft="@id/feld4"
    android:layout_below="@id/feld4"
    android:id="@+id/hor4"
    />

 <View 
    android:layout_width="50dp" 
    android:layout_height="5dp"
    android:background="#FF0000"

    android:layout_alignLeft="@id/feld5"
    android:layout_below="@id/feld5"
    android:id="@+id/hor5"
    />

 <View 
    android:layout_width="50dp" 
    android:layout_height="5dp"
    android:background="#FF0000"

    android:layout_alignLeft="@id/feld5"
    android:layout_below="@id/feld6"
    android:id="@+id/hor6"
    />




<ImageButton
    android:id="@+id/feld1"
    android:layout_width="50dp"
    android:layout_height="50dp"

    android:background="@drawable/leer"
    android:contentDescription="@string/feld"
    android:layout_toLeftOf="@id/vert1"
    android:layout_alignTop="@id/vert1"
    />

<ImageButton
    android:id="@+id/feld2"
    android:layout_width="50dp"
    android:layout_height="50dp"

    android:background="@drawable/leer"
    android:contentDescription="@string/feld"
    android:layout_above="@id/hor2"
    android:layout_alignLeft="@id/hor2"
     />

 <ImageButton
    android:id="@+id/feld3"
    android:layout_width="50dp"
    android:layout_height="50dp"

    android:background="@drawable/leer"
    android:contentDescription="@string/feld"
    android:layout_toRightOf="@id/vert2"
    android:layout_alignTop="@id/vert2"
    />

  <ImageButton
    android:id="@+id/feld4"
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:background="@drawable/leer"
    android:contentDescription="@string/feld"
    android:layout_toLeftOf="@id/vert1"
    android:layout_alignTop="@id/feld5"
    />

 <ImageButton
    android:id="@+id/feld5"
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:background="@drawable/leer"
    android:contentDescription="@string/feld"
    android:layout_centerInParent="true"
    />

<ImageButton
    android:id="@+id/feld6"
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:background="@drawable/leer"
    android:contentDescription="@string/feld"
    android:layout_toRightOf="@id/vert2"
    android:layout_alignTop="@id/feld5"
    />

<ImageButton
    android:id="@+id/feld7"
    android:layout_width="50dp"
    android:layout_height="50dp"

    android:background="@drawable/leer"
    android:contentDescription="@string/feld"
    android:layout_toLeftOf="@id/vert1"
    android:layout_below="@id/hor4"
    />

<ImageButton
    android:id="@+id/feld8"
    android:layout_width="50dp"
    android:layout_height="50dp"

    android:background="@drawable/leer"
    android:contentDescription="@string/feld"
    android:layout_toRightOf="@id/vert1"
    android:layout_below="@id/hor4"
    />

<ImageButton
    android:id="@+id/feld9"
    android:layout_width="50dp"
    android:layout_height="50dp"

    android:background="@drawable/leer"
    android:contentDescription="@string/feld"
    android:layout_toRightOf="@id/vert2"
    android:layout_below="@id/hor4"
    />

<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/winners"
    android:text="@string/winner"
    android:layout_alignParentBottom="true"
    android:textColor="#FFFFFF"
/>

<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/anotherGame"
    android:visibility="invisible"
    android:layout_above="@id/winners"
    android:text="@string/newGameButton"
/>

`

Anyone an idea how to fix?

I already tried the usual. Corrected the ‘mistakes’ in the xml file, cleaned project, built it again and so on. Nothing worked.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:49:45+00:00Added an answer on June 15, 2026 at 2:49 am

    While Sam is on the right track, it is actually bad practice to user @+id/ when you are not setting the android:id attribute. @+id/ actually tries to add that id to your R file if it does not already exist. This can cause problems where you remove the element that another one aligns based on but an error will not be thrown since you are using @+id/

    Instead, you should define the layouts above views that align based on them in your xml file. For Example, winners should go below anotherGame

    <Button
        android:id="@+id/anotherGame"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/winners"
        android:text="@string/newGameButton"
        android:visibility="invisible" />
    
    <TextView
        android:id="@+id/winners"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:text="@string/winner"
        android:textColor="#FFFFFF" />
    

    If you absolutely cannot get around having all views declared above the views that align based on them, you can fall back on using @+id/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the problem I'm trying to solve for my game. I have this
Here a simple question : What do you think of code which use try
Here is what I am currently doing. PHP echo's out the recent post in
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
here is the site : http://www.notrepanorama.com at the bottom left, i use a jquery
Here's my problem I have this javascript if (exchRate != ) { function roundthecon()
Here is what I want to do. Use this HTML line and have the
Here is the problem that I am trying to solve. I have two folders
Here is my problem : I have a post controller with the action create.
Here is my problem. Our tech. writer or customer service will often create new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.