Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10280] iOS: View: Hiding a view do not shifts all the views below, up on the screen.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-01-24T09:27:11.000+0000
Affected Version/sRelease 2.1.1
Fix Version/sRelease 3.0.2, Release 3.1.0, 2013 Sprint 01 Core, 2013 Sprint 01
ComponentsiOS
Labelscore, module_views, qe-ios070112, qe-testadded, regression
ReporterShyam Bhadauria
AssigneeMax Stepanov
Created2012-08-01T02:34:47.000+0000
Updated2013-02-20T21:12:00.000+0000

Description

This is a regression. It works fine on 2.1.0. Steps to reproduce 1. Use the app below
var win = Ti.UI.createWindow({backgroundColor:'black'});
 
var scrollView = Ti.UI.createScrollView({
    layout:'vertical',
    contentHeight:'auto',
    top:0,bottom:0,left:0,right:0
});
win.add(scrollView);
win.open();
 
var len = 2;
 
for(var i = 0; i < len; i++){
    scrollView.add(
        Ti.UI.createView({
            top:5,
            left:20,
            right:20,
            backgroundColor:'white',
            height:80
        })
    );
}
 
var magicView = Ti.UI.createView({
    top:5,
    left:30,
    right:30,
    backgroundColor:'red',
    height:100
});
var viewThatWillGetPushedToTheTop = Ti.UI.createView({
    top:5,
    left:30,
    right:30,
    backgroundColor:'green',
    height:100
});
 
scrollView.add(magicView);
scrollView.add(viewThatWillGetPushedToTheTop);
 
for(var i = 0; i < len; i++){
    scrollView.add(
        Ti.UI.createView({
            top:5,
            left:20,
            right:20,
            backgroundColor:'white',
            height:80
        })
    )
}
 
scrollView.add(Ti.UI.createView({backgroundColor:'blue',height:100,top:10}))
 
setTimeout(function(){
    magicView.hide();
    viewThatWillGetPushedToTheTop.top -= magicView.height
},4000);
2) Run the app on iOS simulator Expected result: 1) Should see a simple window with a scrollView. In the scrollView there are two white views, a red view, a green view, two more white views, and a blue one. After a 4 second timer, the red view is removed and the green view along with all the below white and blue views are pushed up. When this happens, the blue one (which is 100px height) should not cut off at the middle. Actual result: 1) A simple window with a scrollView is displayed. In the scrollView there are two white views, a red view, a green view, two more white views, and a blue one. After a 4 second timer, the red view is removed and the green view is pushed up. When this happens, the blue one (which is 100px height) is not cut off at the middle. But the white views (which are below green view) and the blue view are not moved up after removal to red view.

Comments

  1. Shyam Bhadauria 2012-08-01

    On further investigation, found that this issue is not reproducible every time. It occurs at random. Most of the time,it works as expected.I encountered it on the first run of the app and then only a couple of times in next 20 runs.
  2. Blain Hamon 2012-08-23

    Possibly a race condition on layout.
  3. Sabil Rahim 2012-08-23

    This seems like vertical layout issue , where relayout is not getting triggered properly when the middle view is changing its layout values. Reassigning this ticket to the core team.
  4. Vishal Duggal 2013-01-04

    I can't reproduce this in either 3_0_X or master. Might have gotten fixed with other scroll view fixes. Does occur on the 2_1_X branch though
  5. Max Stepanov 2013-01-04

    @Vishal, i have an idea i'm trying to verify
  6. Max Stepanov 2013-01-07

    Proposed PR https://github.com/appcelerator/titanium_mobile/pull/3667
  7. Anshu Mittal 2013-01-21

    Tested with: SDK:3.1.0.v20130114171802 Studio:3.0.1.201212181159 Device: iPad2(v 5.1), iPhone3GS(v 5.0.1), iPhone5(v 6.0), iPhone4s(v 5.1)
  8. Vishal Duggal 2013-01-21

    Reopening to add comments Backport Task TIMOB-12317 Backport PR https://github.com/appcelerator/titanium_mobile/pull/3749
  9. Anshu Mittal 2013-01-24

    Reopening to update labels

JSON Source