[Tex/LaTex] Place text above frame title in beamer

beamerheader-footer

I want to place a line of text at the top of a frame (above the frame title and default frame headline} such as:

\begin{frame}
    My top of frame text
    \frametitle{My title}
    My frame body
\end{frame}

but beamer automatically reformats. Do you have any suggestions? Thanks.

Best Answer

Here, I added a left-aligned \smashed stack on top of the frame title. It appears to have the same spacing as when the \frametitle is merely plain text. Having a full MWE from the OP would have helped to understand if this approach is adequate.

\documentclass{beamer}
\usepackage{stackengine}
\renewcommand\stackalignment{l}
\begin{document}
\begin{frame}
    My top of frame text
%\frametitle{My title}
    \frametitle{\stackon{My title}{%
      \smash{\scriptsize extra text above the frame title}}}
    My frame body
\end{frame}
\end{document}

enter image description here