Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Deleting scrollView and textField's
Started by hayful59 May 05 2019 08:50 PM

4 replies to this topic
scrollview textbox textfield remove delete nil display scroll view
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

hayful59

[GLOBAL: userInfoPane.html]
hayful59
  • Enthusiast

  • 39 posts
  • Corona SDK

Hello, Im drawn to the screen a scrollView that Im using for the instruction but I cant seem to remove/delete it ive tried using this:

display.remove(scrollView)
scrollView = nil;

It doesnt seem to do anything, the same thing happens when I try to remove/delete a textField. Does anyone know why this keeps happening?

 

Thanks



[TOPIC: post.html]
#2

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,757 posts
  • Corona SDK

We need to see more code. I suspect that your scrollView variable is out of scope in the place you are trying to delete it, but will need to see what you're doing to confirm.

[TOPIC: post.html]
#3

hayful59

[GLOBAL: userInfoPane.html]
hayful59
  • Enthusiast

  • 39 posts
  • Corona SDK

We need to see more code. I suspect that your scrollView variable is out of scope in the place you are trying to delete it, but will need to see what you're doing to confirm.

 

Sorry about that, heres what Im working with, sorry about the code being centered, thanks

        helpButton = widget.newButton
        {
            left = width - width + 20,
            top = height - 36,
            width = 60,
            height = 100,
            --defaultFile = "buttonUnpressed.png",
            --overFile = "buttonPressed.png",
            label = "Runs Help",
            onEvent = helpButtonEvent,    
        }


        function helpButtonEvent(event)
            phase = event.phase
            
            if closing == true then
                infoScroll:removeSelf()
                infoScroll = nil
            end
            
            if "began" == phase then
    
                cluthaButtonTrigger = false
                ranfButtonTrigger = false
                centButtonTrigger = false
                soButtonTrigger = false
                mainMenu = false
                helpButtonTrigger = false
                print("mainMenu (help button event)=",mainMenu)
                
                deleteHelpButton = widget.newButton
                {
                    left = 0,
                    top = height - height - height/3,
                    width = width,
                    height = height + height,
                    defaultFile = "pink.png",
                    onEvent = closeHelpScreenEvent,
                    
                }
            
                local infoScroll = widget.newScrollView
                {
                    left = display.contentWidth - 290,
                    top = 0,
                    width = display.contentWidth/1.18,
                    height = display.contentHeight,
                    topPadding = 10, -- 380
                    bottomPadding = -70, -- -350
                    horizontalScrollDisabled = true,
                    verticalScrollDisabled = false,
                    listener = scrollListener,
                }


[TOPIC: post.html]
#4

hayful59

[GLOBAL: userInfoPane.html]
hayful59
  • Enthusiast

  • 39 posts
  • Corona SDK

We need to see more code. I suspect that your scrollView variable is out of scope in the place you are trying to delete it, but will need to see what you're doing to confirm.

 

Do you have any ideas?



[TOPIC: post.html]
#5

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,024 posts
  • Corona SDK

declare infoScroll at the top of your module




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: scrollview, textbox, textfield, remove, delete, nil, display, scroll, view