[Tex/LaTex] How to hide the navigation bar in LaTex beamer

beamer

I am using LaTeX Beamer to prepare a presentation with lots of content. The navigation bar contains too many subsections, so as to occupying large spaces. See following screenshot:
navigation bar occupying large spaces

I tried \setbeamertemplate{navigation symbols}{}. This command could remove symbols on the bottom, but not the top navigation bar.

I also tried \setbeamertemplate{headline}{}. However, this command only remove all contents in navigation bar, the navigation bar now look like this:
enter image description here

So how to hide the navigation bar? Or just hide the subsection part (right half)?

Edited: I give a short but complete example of LaTeX codes:

\documentclass{beamer}

\mode<presentation>
{
  \usetheme{Warsaw}
  %\setbeamercovered{transparent}
  \usecolortheme{seahorse}
  %\usecolortheme{rose}
  \usefonttheme[onlylarge]{structuresmallcapsserif}
  \usefonttheme[onlysmall]{structurebold}
}

\newcommand*\oldmacro{}
\let\oldmacro\insertshorttitle % save previous definition
\renewcommand*\insertshorttitle{
\oldmacro \hfill  \leftskip=.3cm
  \insertframenumber\,/\,\inserttotalframenumber}

\usepackage[english]{babel}
\usepackage{color}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{ifthen}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{latexsym}
\usepackage{tipa}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{bm}
\usepackage{mathrsfs}
\usepackage{ifpdf}
\usepackage{hyperref}

\begin{document}

%   if do not use navigation symbols (on the bottom), uncomment this
%\setbeamertemplate{navigation symbols}{}

%\setbeamertemplate{headline}
%{%
%\begin{beamercolorbox}{section in head/foot}
%\vskip2pt\insertnavigation{\paperwidth}\vskip2pt
%\end{beamercolorbox}%
%}

\title{C++}

\author{Author}

\date{\today}

%\AtBeginSection[] %
%{
%  \begin{frame}<beamer>
%    \frametitle{Outline}
%    \tableofcontents[currentsection,subsectionstyle=show/show/hide]
%  \end{frame}
%}

\AtBeginSubsection[] %
{
  \begin{frame}<beamer>
    \frametitle{Outline}
    \tableofcontents[currentsection,currentsubsection,subsectionstyle=show/shaded/hide]
    %\tableofcontents[currentsubsection,subsectionstyle=show/shaded/hide]
  \end{frame}
}

% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command:
%\beamerdefaultoverlayspecification{<+->}

\begin{frame}
  \titlepage
\end{frame}

\begin{frame}
  \frametitle{Outline}
  %\tableofcontents[pausesections,subsectionstyle=hide]
  \tableofcontents[currentsection,sectionstyle=show,subsectionstyle=hide]
  % You might wish to add the option [pausesections]
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   main


\section{STL}

\subsection{vector}
\begin{frame}[t]
\frametitle{STL} %
\begin{itemize}
\item STL.
\end{itemize}
\end{frame}

\subsection{list}
\begin{frame}[t]
\frametitle{STL} %
\begin{itemize}
\item STL.
\end{itemize}
\end{frame}

\subsection{stack}
\begin{frame}[t]
\frametitle{STL} %
\begin{itemize}
\item STL.
\end{itemize}
\end{frame}

\subsection{queue}
\begin{frame}[t]
\frametitle{STL} %
\begin{itemize}
\item STL.
\end{itemize}
\end{frame}




\subsection{map}
\begin{frame}[t]
\frametitle{STL} %
\begin{itemize}
\item STL.
\end{itemize}
\end{frame}


\subsection{set}
\begin{frame}[t]
\frametitle{STL} %
\begin{itemize}
\item STL.
\end{itemize}
\end{frame}


\subsection{iterator}
\begin{frame}[t]
\frametitle{STL} %
\begin{itemize}
\item STL.
\end{itemize}
\end{frame}

\end{document}

Best Answer

Warsaw theme loads shadow outer theme which loads split outer theme. You can use compress option to flat navigation top bar. This way all sections and subsections will appear in a horizontal list instead of vertical.

\documentclass[compress]{beamer}

it's all you need.

If you don't want any headline would be better to use some other theme like Pittsburg, Rochester or Madrid, but you can still use Warsaw and suppress headline with

\setbeamertemplate{headline}{}