When the matter truly requires it, it is permitted to do something that appears as though one is acting proudly.
Sefer HaMidos, Haughtiness, Part I §24