text-size

How to change spinner text size?

早过忘川 提交于 2019-12-19 10:35:08
问题 I'd like to learn about spinner and how to change spinner text size and spinner text color. 回答1: In Android, Spinner is nothing but a combo box or list box. It lets you viewing multiple items and allows you to select one item from the list. Edit Your XML code like this <Spinner android:id="@+id/Spinner01" android:layout_width="wrap_content" android:layout_height="wrap_content" /> Your Java Class code should look like this public class SpinnerExample extends Activity { private String array

Android: measureText() Return Pixels Based on Scaled Pixels

馋奶兔 提交于 2019-12-17 10:49:10
问题 So I use Paint's measureText() method to measure the width of a segment of text, but I wanted to measure text based on a certain text size. Say I wanted to get the width of a text segment that will be 20 scaled pixels when it occupies a certain TextView. I tried the following: Paint paint = new Paint(); paint.setTextSize(20); paint.measureText("sample text"); However, it does not seem to be working. I believe it is returning a width with respect to a smaller text size. I feel like I'm missing

Different font size of strings in the same TextView

风格不统一 提交于 2019-12-17 02:34:12
问题 I have a textView inside with a number (variable) and a string , how can I give the number one size larger than the string ? the code: TextView size = (TextView)convertView.findViewById(R.id.privarea_list_size); if (ls.numProducts != null) { size.setText(ls.numProducts + " " + mContext.getString(R.string.products)); } I want ls.numproducts has a size different from the rest of the text. How to do? 回答1: Use a Spannable String String s= "Hello Everyone"; SpannableString ss1= new SpannableString

Customizing text (text size, text color, text angle) in Plotly for R

隐身守侯 提交于 2019-12-13 03:29:39
问题 I'm working on making a donut chart/open pie chart in Plotly. Because of help from this question, Open Pie Chart/Donut Chart in R using Plotly with count and percentage, I was able to get fairly far with my plot. However, now I need help customizing the text size, angle, and color. Here's the dataset: library(dplyr) testfile <- tibble(personID = 1:10, status = c("bad", "good", "bad", "bad", "bad", "bad", "bad", "bad", "bad", "good"), department = c("sales", "sales", "marketing", "sales",

Android set TextView text size to look the same on all screen sizes

混江龙づ霸主 提交于 2019-12-12 06:12:00
问题 I have a square LinearLayout containing a few other LinearLayouts with ImageViews and TextViews inside. I am saving the layout content as png file after the user changes it. All the Images and Texts are being arranged using the general gravity and layout_gravity values. Here is a small sample: Here is my problem: I want the SAMPLE TEXT to look exactly the same size on all screen sizes, being a phone of 480p or a tablet of 1200p. Initially I thought that setting the text size in SP will be

TextInputLayout error message size

老子叫甜甜 提交于 2019-12-12 03:47:26
问题 Is there a way to force the TextInputLayout error message to take a single line ? I tried to place app:errorTextAppearance="@style/error_appearance" on the TextInputLayout with the error_appearance style containing : <item name="android:maxLines">1</item> <item name="android:ellipsize">end</item> <item name="android:inputType">text</item> and it does not work. Changing the color works however. I don't get it, the mErrorView is just a TextView, it should work. 回答1: It's true the the error text

Actually changing text size with OCaml Graphics

痴心易碎 提交于 2019-12-11 12:19:19
问题 I was wondering how to set text size in OCaml. I tried Graphics.set_text_size which should do the deal I guess. But whether I put set_text_size 200 or set_text_size 20 doesn't change a thing… 回答1: Graphics.set_text_size is not implemented yet. https://github.com/ocaml/ocaml/blob/trunk/otherlibs/graph/graphics.ml#L165 https://github.com/ocaml/ocaml/blob/trunk/otherlibs/graph/text.c#L36 https://github.com/ocaml/ocaml/blob/trunk/otherlibs/win32graph/draw.c#L350 回答2: maybe for now, Graphics.set

Increasing and Decreasing the font sizes of the android application by user selection

烂漫一生 提交于 2019-12-11 09:49:10
问题 Actually i want to specify the custom text size in my application by user selection. Below is a figure that demonstrate the idea/theme So, for that i have an idea to achieve this. I will create a dialog in the view which having the user input options to increase/ decrease the font size. after changing the font size, i vll apply the same to the application. (+) & (-) signs will work to change the font size as well as seek bar too. Here my question is is there any specific font style/ size

Saving Text Size in shared preference

て烟熏妆下的殇ゞ 提交于 2019-12-11 07:39:57
问题 I'm trying out to save the text size in shared preference ,while running the project my application stops unexpectedly here is the code : SharedPreferenceActivity.class package com.SharedPreference; import android.app.Activity; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.SeekBar; public class SharedPreferenceActivity extends Activity { SeekBar seek=(SeekBar

How can I change the size of a System.out.println local variable inside a JFrame

眉间皱痕 提交于 2019-12-11 06:54:55
问题 I modified some code I found to display a local variable instead of set text inside of a JFrame, but I'm unable to find a way to change the size of the text. I keep reading about frameName.setFont(new Font(____)), but that doesn't seem to be working for the println. How would I modify the text size? Here's my current code. (P.S. I'm new, so I'm sorry that i don't know what I'm talking about.) import java.util.*; import java.io.*; import java.awt.*; import javax.swing.*; import java.time.*;