I am creating a beamer presentation with several slides that features a tikz picture above an item list. Because one of the objects changes size in the text picture on each slide, the text and the tikz picture shift position as I change slides. How can I keep the position of the text and the tikz picture fixed for all slides? I have attached an image of the problem and some tex code demonstrating it.
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\footnotesize
\begin{tikzpicture}
\def\wl{2}
\def\wh{0.8}
\def\posx{210}
\begin{scope}[xshift=-50]
\draw[black,dashed] (0,0) -- (pi*\wl,0);
\end{scope}
\begin{scope}[xshift=\posx,scale=1,transform shape]
\fill[black] (-2,-2) rectangle ++(4,4);
\end{scope}
\end{tikzpicture}
\begin{itemize}
\item This page has 3 lines
\item This page has 3 lines
\item This page has 3 lines
\end{itemize}
\end{frame}
\begin{frame}[t]
\footnotesize
\begin{tikzpicture}
\path (-2,-2) rectangle ++(4,4);
\def\wl{2}
\def\wh{0.8}
\def\posx{210}
\begin{scope}[xshift=-50]
\draw[black,dashed] (0,0) -- (pi*\wl,0);
\end{scope}
\begin{scope}[xshift=\posx,scale=1,transform shape]
\fill[black] (-1,-1) rectangle ++(2,2);
\end{scope}
\end{tikzpicture}
\begin{itemize}
\item This page has 2 lines
\item This page has 2 lines
\end{itemize}
\end{frame}
\end{document}
\begin{frame}[t]
instead of\begin{frame}
the slides won't jump but of course if the pictures have different heights the texts will move.\path (-2,-2) rectangle ++(4,4);
in the second figure and don'tdraw
in the first, only fill it, to avoid different strokes.\fill[black] ...
[t]
on frames as suggested? It is working here.