iOS 子视图跟随父试图改变

//view1父视图

 view1.autoresizesSubviews =YES;

//view2子视图

    view2.autoresizingMask =

    UIViewAutoresizingFlexibleLeftMargin   |

    UIViewAutoresizingFlexibleWidth        |

    UIViewAutoresizingFlexibleRightMargin  |

    UIViewAutoresizingFlexibleTopMargin    |

    UIViewAutoresizingFlexibleHeight       |

    UIViewAutoresizingFlexibleBottomMargin ;

你可能感兴趣的:(iOS)