我正在尝试实现一个播放RTMP url的应用程序,我已经使用libvlc sdk完成了这项工作。
现在我想分割屏幕不止一个部分,并且想播放rtmp url,我遇到了分割屏幕的问题,任何建议都将不胜感谢
发布于 2017-06-16 14:41:42
要拆分Android活动,你应该使用fragment类,它允许你动态地显示多个任务。可以使用fragment类。
步骤: 1.创建片段类
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.ViewGroup;
public class yourFragmentName extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.article_view, container, false);
}
}<FrameLayout android:id="@+id/your_placeholder" android:layout_width="match_parent" android:layout_height="match_parent"> </FrameLayout>
第二个片段的FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); // Replace the contents of the container with the new fragment ft.replace(R.id.your_placeholder, new FooFragment()); // or ft.add(R.id.your_placeholder, new FooFragment()); // Complete the changes added above ft.commit();
有关更多解释,请参阅https://guides.codepath.com/android/Creating-and-Using-Fragments
发布于 2017-06-16 14:53:34
在片段的帮助下,你可以将屏幕分割成多个部分,每个部分都有自己的UI
https://stackoverflow.com/questions/44582168
复制相似问题