片段屏幕在更改方向和背景颜色时切开,切换到其他应用
我想在片段内的表中显示一些数据,一旦单击MainActivity,就单击了按钮。由于表更宽,因此我将屏幕的方向更改为景观,然后在片段的OnCreateview功能中动态创建表。该表仅显示一半数据,就好像是在肖像模式下打开的一样。另外,如果我切换到手机中的其他应用程序,则省略了某些零件的背景颜色。请帮我。
I want to show some data in a table inside a fragment once clicked a button in mainActivity. Since the table is wider, i change the orientation of the screen to landscape before dynamically creating the table in onCreateView function of the fragment. The table only shows half of the data as if it was opened in a portrait mode. Also if i switch to other apps in the phone, background color of the table in some parts get omitted. please help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了这个问题。片段屏幕显示在框架布局上。因此,在加载片段后,我通过调用以下功能从mainActivity中放置的帧布局,使用片段中的mainActivity使用以下函数。
((MainActivity)getActivity())。resize();
以下代码以主攻击性编写。
public void resize(){
}
在这里,我在景观视图中将高度进一步降低了270,因为由于缺少Framelayout的某些问题。不知道为什么。希望它有帮助。
I solved the issue. The fragment screen was shown on a frame layout. so after loading the fragment i resized the Frame layout which was placed in the MainActivity by calling the below function from mainActivity in the fragments onCreate() function using
((MainActivity) getActivity()).reSize();
the below code is written in the mainActivity.
Public void reSize(){
}
Here i have reduced the height further by 270 in the landscape view because due to some issue some part of the framelayout was missing. don't know why. Hope it helps.