Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
The performance of button.name is kind of slow?
-
-
@lpl sure your req_data does not access internet?
Is it possible to replace your buttons by labels, title->text, only for scrolling, not for clicking, just to see if speed better?
-
@cvp Did you notice "bg"? This means backgroud, and it just send requests. And I use load_data to load the result into view.
-
@lpl ok, sorry
Do you think it is possible to replace buttons by labels if you don't tap them? -
@cvp I compared before, and no white parts with Label.
-
@lpl First, I restarted Pythonista and the error disappears, it was in module ui.py???
Could you try to comment the line where you set dynamically the action of the button
-
@lpl As I don't understand the displayed language, could you tell me what I have to do to get the indexes list?
Edit: found what I have to tap: menu top right/3rd blue line
-
@cvp Sure. https://github.com/yjqiang/yj_ebook_reader/blob/master/index_viewer/index_viewer.py#L109 I use self.cur_offset and the new offset to check whether users are scrolling down or up.
If scrolling down(the scrollbar is going down), I use https://github.com/yjqiang/yj_ebook_reader/blob/master/index_viewer/index_viewer.py#L122 to handle this. If the lastest part of the subviews is done (https://github.com/yjqiang/yj_ebook_reader/blob/master/index_viewer/index_viewer.py#L126), I will move the first part of the subviews to the end of them(https://github.com/yjqiang/yj_ebook_reader/blob/master/index_viewer/index_viewer.py#L137-L141) -
@lpl if I comment all the lines where you change .title, you are right, no blank...
-
@lpl only line 137 needs to be commented and white disappears...
-
@cvp But the function is broken… If you delete L137
-
@lpl I understand, it is only to show from which line the problem comes. It is not yet a solution...
-
@cvp So the performance of
button.title
is not good. -
@lpl It seems, yes. Thus you were right from the beginning 😀
-
-
@lpl Really not sure that could help, but you could try to add a label as subview of the button, with transparent background so the button stays clickable, and set the label.text instead of the button.title
-
@cvp said:
@lpl Really not sure that could help, but you could try to add a label as subview of the button, with transparent background so the button stays clickable, and set the label.text instead of the button.title
I'll have a try. And thx again.
-
@lpl The problem is not for @omz. It seems it comes from animation of UIButton when its title changes
-
-
@lpl, do you have a compelling reason to use a button instead of a custom View with touch_ended? Custom view will also let you do whatever you want with images and labels.