Support both portrait and landscape mode