He spoke about the film during a campaign fundraiser at producer Harvey Weinstein's Connecticut home.
The political leader said that Anne was "spectacular" in the film.
He said: "I got a chance to see 'Batman', and she was the best thing in it. That's just my personal opinion."
Anne, who laughed at Obama's flattery, was in attendance as one of the evening's co-hosts, along with Joanne Woodward, Aaron Sorkin and Weinstein.
Also at the $35,800-per-plate dinner was Jerry Springer and American Vogue editor-in-chief Anna Wintour.
Anne recently said getting her hair cut short for 'Les Miserables' was "scarier" than jumping off buildings.
The 29-year-old actress got her tresses trimmed for her role of Fantine in Tom Hooper's forthcoming big-screen adaptation, and she admits it was "terrifying" compared to some of the stunts she has to do in her portrayal of Catwoman in 'The Dark Knight Rises'.
She said: "It was terrifying. I didn't expect it because in this film ['The Dark Knight Rises'], I do backflips out of windows, I jump off of buildings, I do all sorts of scary things but nothing was as scary as cutting my hair off."