How do I get the text height of a spinner control? String Utils function doesn't work and gives a Java error that it is expecting an Edit Text and I gave it a spinner...I can't fool it by dimming an EditText and pointing it to the spinner either...I tried, and I don't want to create an EditText and add it to the panel just to get the text size.
I had another thread where I had text size issues lately too where the Canvas version and the String Util version aren't working the same for some reason. Canvas text width seems to work fine, but height does not give the same results. Even when I use reflection to set the padding to 0 the width from canvas is always too small. I tried with a couple font sizes like 18 and 38, with 18 it was 9 pixels too small and with 38 it was 18 pixels too small. The amount they are too small seems to be pretty close to 50% of the full size. It is like the Canvas version isn't considering full line spacing or something.
Even the String Utils version isn't perfect though and sometimes would be off by just a bit. To actually get the correct result in an Edit Text I have to setpadding to 0 on all 4 sides, set the width to match the needed text width (Otherwise it tries to wrap the given text within the current width and gives that height), then I get the height and add some dips to it and the width that match my 9 Patch then set the 9 Patch which automatically sets the padding and everything is good.
Any chance on seeing the actual functions/code that is called for the Canvas Height and String Utils Height to see what the difference is and how to get this to work right?
I had another thread where I had text size issues lately too where the Canvas version and the String Util version aren't working the same for some reason. Canvas text width seems to work fine, but height does not give the same results. Even when I use reflection to set the padding to 0 the width from canvas is always too small. I tried with a couple font sizes like 18 and 38, with 18 it was 9 pixels too small and with 38 it was 18 pixels too small. The amount they are too small seems to be pretty close to 50% of the full size. It is like the Canvas version isn't considering full line spacing or something.
Even the String Utils version isn't perfect though and sometimes would be off by just a bit. To actually get the correct result in an Edit Text I have to setpadding to 0 on all 4 sides, set the width to match the needed text width (Otherwise it tries to wrap the given text within the current width and gives that height), then I get the height and add some dips to it and the width that match my 9 Patch then set the 9 Patch which automatically sets the padding and everything is good.
Any chance on seeing the actual functions/code that is called for the Canvas Height and String Utils Height to see what the difference is and how to get this to work right?