I am currently trying to code in beamer the following image. So far I got the three beamercolorbox but I can't get the shaded background.

Here is the aspect I want:

\documentclass[xcolor=dvipsnames,14pt]{beamer}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes}
\usetikzlibrary{calc}
\setlength\fboxsep{0pt}
\setlength\fboxrule{0.5pt}
\setlength\parskip{0.75em}
\setlength\parindent{0pt}
\setbeamersize{text margin left=3mm,text margin right=3mm}{}
\leavevmode\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}%
\end{beamercolorbox}%
}\vskip0pt}

\begin{document}
\section{Section title}
\subsection{Subsection title}
\begin{frame}
\frametitle{Frame title}
some text
\end{frame}
\end{document}


Solution: In fact, I just had to put the shadings in a hbox and use \hskip and \vskip. Here is the solution:

\setbeamertemplate{headline}{
\leavevmode%
\hskip-1mm\hbox{%
}\hskip-128mm\vskip-4ex%
\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}%
\end{beamercolorbox}%
}\vskip0pt%
}

-
Welcome to TeX.SX. The shaded background must be still in the headline or not? Which kind of shading you want to insert? – Claudio Fiandrino Jul 2 '12 at 13:48
Welcome to TEX.SX! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – azetina Jul 2 '12 at 14:03

Let's assume the so called shaded background be placed in the headline template.

In this case, the answer provides a method to insert a vertical shaded background or a simple background.

Simple background

\documentclass[xcolor=dvipsnames,14pt]{beamer}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes}
\usetikzlibrary{calc}
\setlength\fboxsep{0pt}
\setlength\fboxrule{0.5pt}
\setlength\parskip{0.75em}
\setlength\parindent{0pt}
\setbeamersize{text margin left=3mm,text margin right=3mm}{}

% uniform color

\leavevmode\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}%
\end{beamercolorbox}%
}\vskip0pt
\leavevmode\hbox{%
% uniform
\end{beamercolorbox}%

}\vskip0pt
}

\begin{document}
\section{Section title}
\subsection{Subsection title}
\begin{frame}
\frametitle{Frame title}
some text
\end{frame}

\begin{frame}
\frametitle{Frame title 2}
some text
\end{frame}

\subsection{Subsection second title}
\begin{frame}
\frametitle{Frame title}
some text
\end{frame}

\begin{frame}
\frametitle{Frame title 2}
some text
\end{frame}
\end{document}


The background has been inserted by means of:

\leavevmode\hbox{%
% uniform
\end{beamercolorbox}%
}


and the color definition could be modified by changing:

\setbeamercolor{shadedhead}{bg=blue}


You can adapt the dimensions in the options of the beamercolorbox environment.

Two frames of the result:

Let's define as first the shading:

% Shade definition
color(0pt)=(gray!40);
color(10pt)=(gray)}


You can find further informations on the possible shadings in the pgfmanual (also related How to create ball shading and 3D lighting manually?).

Now we apply this shading in the headline template:

\leavevmode\hbox{%
\begin{beamercolorbox}[wd=\textwidth,ht=3ex,dp=2ex]{}%
\begin{pgfpicture}{0pt}{0pt}{\paperwidth}{3ex}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{3ex}}
\pgfusepath{clip}
\end{pgfpicture}
\end{beamercolorbox}%
}


The whole code:

\documentclass[xcolor=dvipsnames,14pt]{beamer}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes}
\usetikzlibrary{calc}
\setlength\fboxsep{0pt}
\setlength\fboxrule{0.5pt}
\setlength\parskip{0.75em}
\setlength\parindent{0pt}
\setbeamersize{text margin left=3mm,text margin right=3mm}{}

color(0pt)=(gray!40);
color(10pt)=(gray)}

\leavevmode\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}%
\end{beamercolorbox}%
}\vskip0pt
\leavevmode\hbox{%
\begin{beamercolorbox}[wd=\textwidth,ht=3ex,dp=2ex]{}%
\begin{pgfpicture}{0pt}{0pt}{\paperwidth}{3ex}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{3ex}}
\pgfusepath{clip}
\end{pgfpicture}
\end{beamercolorbox}%
}\vskip0pt
}

\begin{document}
\section{Section title}
\subsection{Subsection title}
\begin{frame}
\frametitle{Frame title}
some text
\end{frame}

\begin{frame}
\frametitle{Frame title 2}
some text
\end{frame}

\subsection{Subsection second title}
\begin{frame}
\frametitle{Frame title}
some text
\end{frame}

\begin{frame}
\frametitle{Frame title 2}
some text
\end{frame}
\end{document}


Now the same frames of the previous example are diplayed as:

-