For a graph G=(V,E) and vi∈V, denote by di the degree of vertex vi. Let f(x,y)>0 be a real symmetric function in x and y. The weighted adjacency matrix Af(G) of a graph G is a square matrix, where the (i,j)-entry is equal to f(di,dj) if the vertices vi and vj are adjacent and 0 otherwise. Li and Wang \cite{U9} tried to unify methods to study spectral radius of weighted adjacency matrices of graphs weighted by various topological indices. If fx′(x,y)≥0 and fx′′(x,y)≥0, then f(x,y) is said to be increasing and convex in variable x, respectively. They obtained the tree with the largest spectral radius of Af(G) is a star or a double star when f(x,y) is increasing and convex in variable x. In this paper, we add the following restriction: f(x1,y1)≥f(x2,y2) if x1+y1=x2+y2 and ∣x1−y1∣>∣x2−y2∣and call Af(G) the restrictedly weighted adjacency matrix of G. The restrictedly weighted adjacency matrix contains weighted adjacency matrices weighted by first Zagreb index, first hyper-Zagreb index, general sum-connectivity index, forgotten index, Somber index, p-Sombor index and so on. We obtain the extremal trees with the smallest and the largest spectral radius of Af(G). Our results push ahead Li and Wang's research on unified approaches.