How about this one buttonBug.apk (5.0 MB)
I think we were thinking along the same lines:
@SimpleFunction(description=“CenterText”)
public void CenterText(ButtonBase button){
Button btn = (Button)button.getView();
btn.setIncludeFontPadding(false);
btn.setPaddingRelative(0,0,0,0);
btn.setGravity(Gravity.CENTER);
}
Hello @Ken
If you are thinking about the extension for button , then please make it compatible with label also. It would be a great help.
Thanks.
Since I don’t have a device that produces this behavior, it is hard to troubleshoot
All of the .apks I uploaded had the extension but It’s not working
So is there any solution to this problem of mine? And I am very much sure that this problem isn’t originated today. It should be there since long time. As I also said in my original post
Below are Screenshots for this
I wander how didn’t anyone noticed this up-till now
I’ll look again later but I’m not sure if/when I’ll be successful
Actually your font size is to big for the space in button and thereby it cuts of the button at the bottom with 2dp X density(mine is 4)=8px
Thanks for that @Ken . But this is something that related Kodular staff person should look at. Sorry if anyone feels wrong about this. But right now I am feeling helpless as my project has come to stand-still because buttons, labels, etc are one of the basic components of any project and having fault in them ruins your whole project.
Nope Boban I have tried with default font size(i.e. 14) also but the result didn’t change.
See this @Boban
Now here the font size is 14 and button height and width is 12% and 25% respectively (I guess big enough for font size 14)
What happens if you use a .png or other image file instead of font?
text → TEXT →
As you can see, html render it like this, slightly below middle…
Edit: even on different browsers it looks different, I see it like in the image below
That would not be the solution!
As I said earlier, even in original post
I will provide you details later as it is 3:07 AM here
I was just wondering what would happen, I wasn’t suggesting it as a permanent solution…
I checked it in Oppo F11 Pro and Asus Zenfone 4(emulator) and it works pretty well as expected.
Will this assure that it will work same in most of the devices out there?
Also what if I tweak the button properties according to my UI? I guess I have to change everything again.
Secondly, is it good to use non-breakable space entity (
)? As after-all it’s a space and it can vary from device-to-device I think (I may be wrong)
Waiting for your input