Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

native.newtextfield and tableview
Started by laurasweet8888 Dec 02 2019 08:18 AM

7 replies to this topic
native.newtextfield tableview

Best Answer laurasweet8888 , 02 December 2019 - 12:25 PM

OK,  This seems to allow me to track it even tho it is inside the row display group.  

 

local bounds = M.NickNameField.contentBounds 
        print ("M.NickNameField.y",bounds.yMin)
 
So I can track it myself and make it go invisible before it hits the UI element.  However, I think this should happen automatically so I don't have to do this myself :(   
 
More custom code I have to write inside the tableViewListener.   Not fun.  

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

laurasweet8888

[GLOBAL: userInfoPane.html]
laurasweet8888
  • Contributor

  • 121 posts
  • Corona SDK

Hi all, 

 

   I placed a native.newtextfield in a a tableview widget and placed that widget below my UI header.   When I scroll my tableview up my textfield rolls right over my UI.  For example: 

 

Attached File  Capture.PNG   52.99KB   0 downloads

 

I would expect that the tableview would set things inside of it to invisible when the scroll bounds are reached.  Maybe I am missing something.  Probably not returning true somewhere I should be :)   

 

For grins I moved the tableview down to the middle of the device and when scrolling up it did eventually hide the textfield.  But way later than it should have.  So it is doing something.  But I am not sure what.  

 

Thanks, L



[TOPIC: post.html]
#2

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,274 posts
  • Corona SDK

Without any code this is going to be extremely hard to deduce. I would suggest doing the minimal possible example that will produce the problem and post it here. 



[TOPIC: post.html]
#3

laurasweet8888

[GLOBAL: userInfoPane.html]
laurasweet8888
  • Contributor

  • 121 posts
  • Corona SDK

That makes sense.  I was just trying to get a quick gauge of the expected behavior from my post.   



[TOPIC: post.html]
#4

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,274 posts
  • Corona SDK

I have never tried it inside a table view, but I have tried it inside an overlay and it does move with the overlay as long as it is in the same group. I can't imagine why it wouldn't work from a table view.



[TOPIC: post.html]
#5

laurasweet8888

[GLOBAL: userInfoPane.html]
laurasweet8888
  • Contributor

  • 121 posts
  • Corona SDK

It moves just fine.  It just sits on top and doesn't get turned invisible until it is way off the screen.   I just tried to track its whereabouts so that I could manually turn if off before it hits the UI element but since it is part of a row container the y value never changes.  Maybe there is something else I can check other than object.y.   I will keep digging. 

 

 

This looks interesting:   https://docs.coronalabs.com/api/type/DisplayObject/localToContent.html



[TOPIC: post.html]
#6

laurasweet8888

[GLOBAL: userInfoPane.html]
laurasweet8888
  • Contributor

  • 121 posts
  • Corona SDK

  Best Answer

OK,  This seems to allow me to track it even tho it is inside the row display group.  

 

local bounds = M.NickNameField.contentBounds 
        print ("M.NickNameField.y",bounds.yMin)
 
So I can track it myself and make it go invisible before it hits the UI element.  However, I think this should happen automatically so I don't have to do this myself :(   
 
More custom code I have to write inside the tableViewListener.   Not fun.  


[TOPIC: post.html]
#7

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,393 posts
  • Enterprise

native.* objects are not part of the Corona OpenGL canvas. The widget.* objects are built as part of the OpenGL canvas. The two don't interact. In theory we added support to move native.* objects when the group they are fake-added to move, but in general, but other display.* actions like layering them, hiding them, etc. doesn't work.  native.* objects are always on top.

 

This is a physical limitation on how Corona's display objects are built.

 

Rob



[TOPIC: post.html]
#8

laurasweet8888

[GLOBAL: userInfoPane.html]
laurasweet8888
  • Contributor

  • 121 posts
  • Corona SDK

All I was thinking is that nativetextobject.isVisible=false then out of tableview viewing area.  set back to true when it is dragged back in.  I realize you can't make them truly part of a displaygroup.  

 

This is basically, what I am going to try to accomplish in the tableview listener.  

 

Wish me luck. 




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: native.newtextfield, tableview