I had this issue. I wrote a post about it and got a reply by someone called Vassy who was very helpful. Try reattaching the transaction and then you might have to wait a while. If it still doesn't happen then try changing the node that you're connected to (tools, edit node configuration)and reattach again.
I was told the nodes can be overloaded so when you reattach it, it may take a while to confirm, so the best thing you can do is reattach the transaction and wait, if it doesn't confirm then reattach or change the node and then reattach.
I had this problem, my transaction was pending for over 24 hours even though I tried reattaching it and was getting issues. I changed the node as advised by vassy, pressed reattach and left it overnight. When I checked in the morning my iotas were in my balance and the transaction was confirmed.
Hope this helps