Set a new layout for a fragment
문제
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.
제휴하지 않습니다 StackOverflow