Android Question Cannot set button icon

Discussion in 'Android Questions' started by Indy, Jun 26, 2015.

  1. Indy

    Indy Member Licensed User

    Hi,

    I'm trying to set an icon for a button but, the Image File drop-down list is empty. I have definitely copied the png file across into the Files folder, selected the required BitmapDrawable but still nothing. I'm wondering whether there's something I have done because one of my other projects seems fine but, I can't spot any difference.

    Thanks
     
  2. thedesolatesoul

    thedesolatesoul Expert Licensed User

    In the files tab: Sync
     
  3. Indy

    Indy Member Licensed User

    Already tried the Sync option, still nothing.
     
  4. klaus

    klaus Expert Licensed User

    Did you add the files in the designer with the Add Files button ?
     
    NJDude likes this.
  5. Indy

    Indy Member Licensed User

    Yep, done the Add files bit aswell. I can't figure it out. Anyway, to save time I have added the image in code, which has got the job done for now. Personally I like to use the Designer for as much of the layout as I can as it keeps the main code minimal and tidy, and besides, I think Erel would reccomend we do it that way.

    Thanks for your help guys.
     
  6. klaus

    klaus Expert Licensed User

    Sorry, I don't understand. Does it work now in the Designer or not?
    If not, where did you add the files ?
    You should add those in the Designer for each layout file.
     
  7. Indy

    Indy Member Licensed User

    Hi Klaus,

    No, still not working in Designer. I add the files using the Add Files tab and I can see it's brought the file across. However, nothing exists in the drop-down list. But for now I have done the same using code, although I always prefer to do majority of the layout setup in the Designer.
     
  8. klaus

    klaus Expert Licensed User

    Do you set the Drawable property in the Designer to BitmapDrawable ?
    Or post a small project showing the problem.
     
Loading...