Human behaviors are often subject to conformity, but little research attention has been paid to social dilemmas in which players are assumed to only pursue the maximization of their payoffs. The present study proposed a generalized prisoner dilemma model in a signed network considering conformity. Simulation shows that conformity helps promote the imitation of cooperative behavior when positive edges dominate the network, while negative edges may impede conformity from fostering cooperation. The logic of homophily and xenophobia allows for the coexistence of cooperators and defectors and guides the evolution toward the equality of the two strategies. We also find that cooperation prevails when individuals have a higher probability of adjusting their relation signs, but conformity may mediate the effect of network adaptation. From a population-wide view, network adaptation and conformity are capable of forming the structures of attractors or repellers.