tikz-pgf,tikz-arrows – Labeling Bend Arrows in TIKZ Diagrams

tikz-arrowstikz-pgf

How to put a label on a bend arrow in TIKZ.
So currently I have currently managed to add a label in between the arrow, but I am unable to bend the arrow.
Also, when I bend the arrow, I am unable to add the label in between.

\draw[->] (q2)--(q3) node[midway,color=red,fill=white]{0};

I have used the above code to add a label in between the arrow.

How I want it to look
How I want it to look

How it is currently looking
How it is currently looking

Best Answer

Always post compilable code, so other do not have to guess how you make your nodes, bend, ... -and to help others help you.

\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[draw, circle](q2){q2};
\draw (0,-2) node[draw, circle](q3){q3};
\draw[->] (q2) edge[bend left] node[midway, color=red, fill=white]{1} (q3);
\end{tikzpicture}
\end{document}
 

Two nodes with bend arrow