Let $U_i$ denote a family of open subsets of a scheme $X$, which is not affine, so that $X = \bigcup U_i$. Can this covering be somehow transformed into an affine covering of $X$?
It is a fact that the set of affine open subsets of a scheme $X$ form a basis. So yes, your open sets can be broken up into affine opens.
The idea is roughly as follows. In the affine situation, the affine open subsets $D(f)$ form a basis of $Spec(A)$, for all $f \in A$. Now consider the general situation. Take an open (maybe not affine) subset $U$ of $X$. Let $x \in U$. By definition of "scheme", there exists an affine open neighborhood $Spec(A) \ni x$. $U \cap Spec(A)$ is open in $Spec(A)$ so we can find some neighborhood $D(f)$ of $x$ contained in $U \cap Spec(A)$. So we found an affine neighborhood of $x$ contained in $U$.