Git Product home page Git Product logo

Comments (7)

zongren avatar zongren commented on September 24, 2024

如果Fragments没有设置背景色的话,就会出现重叠的现象


screenshot_2016-04-28-16-14-36

from flycotablayout.

H07000223 avatar H07000223 commented on September 24, 2024

横竖屏切换没考虑这边没处理
使用setTabData(ArrayList tabEntitys)方法吧,不要使用那个快捷方法~
然后google下,自己处理😂

from flycotablayout.

zongren avatar zongren commented on September 24, 2024

问题不大,反正不支持横屏 😄

from flycotablayout.

H07000223 avatar H07000223 commented on September 24, 2024

这个需要的话自己单独处理~😄

from flycotablayout.

Christain avatar Christain commented on September 24, 2024

您好,我也遇到了这个问题,我的是Activity被回收以后会出现重叠的情况,当然横竖屏切换也会引起Activity重新加载。我已经通过onSaveInstanceState这个方法保存了tabLayout.getCurrentTab()当前页面的编号,在恢复的onCreate里面tabLayout.setCurrentTab(currentTab);指定了当前页面。但还是出现了重叠现象,这一点感到很困惑。

from flycotablayout.

H07000223 avatar H07000223 commented on September 24, 2024

tabLayout自己就记录了currentTab~ 你不需要再保存~
重叠的原因,说明fragment并没有被销毁,可能要解决的问题是如何重新再找到没有被销毁的当前fragment.而不是重新创建fragment

类似于下面代码(我没试过😂)

@OverRide
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

if (savedInstanceState != null) {  
    simpleFragment = (SimpleFragment) getSupportFragmentManager().findFragmentByTag("xxx");      
}  else{
   simpleFragment =SimpleFragment.newInstance();
   getSupportFragmentManager().beginTransaction()
                 .add(simpleFragment, "xxx")
                ..commit();
}

}

from flycotablayout.

zongren avatar zongren commented on September 24, 2024

我把show,hide改成了replace暂时解决了这个问题

from flycotablayout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.