Add space between graph and tick labels in GraphView? answers how to add a space between the graph and axis labels
Android graph view has an answer which says it is possible to change the font size of axis labels.
However it seems those functionalities have been removed. are there any plans to reinstate them? Alternatively, are there currently ways to change the font size and spacing?
Thanks!
I change the label's text size in this way:
graph.getGridLabelRenderer().setTextSize(6f);
graph.getGridLabelRenderer().reloadStyles();
Related
I am trying to find a library or a simple trick to fix the width of each letter in an EditText so that the dashed lines on the background match exactly the number in the EditText. You can see the photo for the desired effect.
Using various widget i.e. Edittext in a row with the text style to underline will helps to get these type of design else i don't think there is any hard and fast rule or tricks.
There is no simple way of doing this, especially not when aligning to a given background, because many factors such as display size and density can change the relative positioning of the EditText. You could perhaps work around this limitation by drawing the white lines under each digit yourself, using a custom font or underlining and separating the digits with a space. See this question for a more detailed explanation on the limitations and possibile solutions concerning letter spacing.
I only know that, font monospace will be useful. Other fonts set different widths to each character.
I am using MPAndroidChart, I want to set the barchart values in center of the bar and with bigger font.
mChart.setDrawValueAboveBar(false);
By using the above the value is shown inside the bar but not at the center.I am using MpChart
Thanks in advance
By default, it is not possible to center the values, you will have to add that feature yourself.
Concerning the textsize, try:
barDataSet.setValueTextSize(...)
Styling individual DataSets
Styling all ChartData
I have two question by AChartEngine:
1. How add margin between YLabel and chart?
2. I change label text size but when no data it's not working, what I can use instead?
Screenshot for fisrt question:
Regards
Is there a more precise way of arranging components in App Inventor than using the Vertical/Horizontal/Table Arrangement formatting elements?
I want to sparsely position about six buttons across my app screen - all different sizes.
Thank you in advance.
the short answer is: no
well, additionally you also could use empty labels as delimiter between components...
another answer is: you could use a canvas and sprite components instead of buttons. You can define sprite positions exactly at x/y coordinates of your canvas.
However keep in mind, that there are different Android devices with different screens sizes and resolutions, so normally you wouldn't set buttons exactly at x/y coordinates to avoid strange layouts for e.g. smaller or larger devices.
The bit longer answer is to use labels as spacers.
Example:
Need to center a button at the top of the screen.
Add horizontal layout with 2 label texts and button in center inside of the layout.
Click each text label and remove the actual text from right side properties menu and choose fill parent width and height.
This centers the button because the layout automatically assigns one third size to each.
Labels are the best, but longer coding answer.
I'm developing android application using Titanium 3.X. I need to add an image and a label (name) in a way that label is next to the image in same row and both should be right aligned. The problem is label text which represent a name is dynamic. So I can't set right property for the image view. I need to do this in a way which compatible with different devices (Screen sizes). I have given my font size as 11dp.
right property for image can be calculated by some algorithm which accepts font size, device screen width etc. But I couldn't identify it. Can anyone suggest me a way to resolve this ?
In this situation, I would add a view to wrap the image and label. I would set the view's layout to horizontal. I would then right align the view.
You should use a layout that will do the computations for you.
The RelativeLayout is quite useful in such situations. When you construction it in XML there are attributes like alignParentRight or layout_toRightOf that should prove useful. Don't forget to set the width of the TextView as wrap_content.