문제

Is it possible to set a new layout for a fragment, in a way similar to Activity.setContentView? Or the only way to change the layout of a fragment is to replace it, and inflate a different layout during onCreateView()?

도움이 되었습니까?

해결책

The answer is no. So far I have not found much use with fragments, the only thing good is that it has its own life cycle methods. The draw back is that the fragment transition is a pending intent, that can cause problems sometimes.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top