android-textattributes


Missing TextAppearances.Micro style

时光毁灭记忆、已成空白 提交于 2020-02-04 20:44:24
问题 According to Android Developer Design Style for Typography, there are 4 TextAppearance s (Micro, Small, Medium, Large). But there is no predefined style for Micro: ?android:attr/textAppearanceMicro android:style/TextAppearance.Micro None of them can be found in sources of Android. What am I missing? 回答1: Good question! After researching a little bit, I didn't find any results for "TextAppearance.Micro". On the other hand, I found the official Android source for style resource related to

Missing TextAppearances.Micro style

邮差的信 提交于 2020-02-04 20:43:09
问题 According to Android Developer Design Style for Typography, there are 4 TextAppearance s (Micro, Small, Medium, Large). But there is no predefined style for Micro: ?android:attr/textAppearanceMicro android:style/TextAppearance.Micro None of them can be found in sources of Android. What am I missing? 回答1: Good question! After researching a little bit, I didn't find any results for "TextAppearance.Micro". On the other hand, I found the official Android source for style resource related to

How do I change color of a certain part of my textview?

不打扰是莪最后的温柔 提交于 2020-01-06 01:32:24
问题 I am using 2 parts in a textview, 1st part is date another is name and email. They are both referenced in the same textview. I would like to change the color of the date to give it a different visual it from name and email. is it possible to do this without actually adding a whole new textview for name and email? Here's my code so far: String nameandemail; holder.mytext.setText(String.valueOf(dateFormat.format(new Date(msg.getDate())) + " " + nameandemail + ": ")); How do I make it such that

How do I change color of a certain part of my textview?

半腔热情 提交于 2020-01-06 01:32:11
问题 I am using 2 parts in a textview, 1st part is date another is name and email. They are both referenced in the same textview. I would like to change the color of the date to give it a different visual it from name and email. is it possible to do this without actually adding a whole new textview for name and email? Here's my code so far: String nameandemail; holder.mytext.setText(String.valueOf(dateFormat.format(new Date(msg.getDate())) + " " + nameandemail + ": ")); How do I make it such that

Clickable words inside of TextView Android [duplicate]

。_饼干妹妹 提交于 2019-12-30 11:04:51
问题 This question already has answers here : Create clickable link in text view in android (2 answers) Closed 5 years ago . I have a textview that contains hashtags ex. #first #second #third . My question is how can I detect which hashtag is clicked so I can perform some action - eg. make toast of the word. Is this possible using TextView widget? Should I use some other widget istead? UPDATE I found my solution using this example. Hope it will help others in the future! 回答1: You can use spannable

The text color does not change TabWidget

半世苍凉 提交于 2019-12-23 23:26:45
问题 I'm trying to change the TabWidget text color, without success, even though I've tried different way to change it (see code below.) My background tabs is an image: for (int i = 0; i < tabHost.getTabWidget().getTabCount(); i++) { tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.TRANSPARENT); } I do not know if this creates some sort of conflict with what I want to do now. Solution1: main.xml .... <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android

Change EditText hint color when using TextInputLayout

北慕城南 提交于 2019-12-17 03:56:12
问题 I am using the new TextInputLayout from the design library. I am able to get it to show and to change the color of the floating label. Unfortunately the actual EditText hint is now always white. I have tried changing the hintColor in XML, styles, and programmatically and also tried using the android.support.v7.widget.AppCompatEditText but the EditText hint always shows white. Here is my XML for my TextInputLayout and EditText <android.support.design.widget.TextInputLayout android:layout_width

Text view returning wrong text size

别说谁变了你拦得住时间么 提交于 2019-12-12 18:34:27
问题 I need to get the text size of the text view so that I would increment in text size while user pressing the button which indicates that it helps in increasing the text size in the text view. Let me clear what I have done so far i have a text view and setting its text size through dimen folder <TextView android:id="@+id/tv_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="2dp" android:text="@string/flash" android:textSize="@dimen/tv_text_fontsize"

TextView taking/consuming too much space above and below the text

橙三吉。 提交于 2019-12-12 00:24:56
问题 The text view encircled has too much space above and below its text. It is inside the text view (not above and below of it). I neither used margins nor paddings but it is remained there. The xml code is there. <TableRow android:id="@+id/tbRow" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/viewLineSeparator" android:layout_gravity="top" android:layout_marginBottom="2dp" android:layout_marginTop="1dp" android:gravity="top" android:weightSum=

android get textappearance runtime

眉间皱痕 提交于 2019-12-10 11:05:10
问题 I have overriden the textview class and I want to perform some things when the textappearance is small. How do I check the textappearance that has been set by the xml layout file? 回答1: i have found a workaround: private int getTextAppearance(AttributeSet attrs, int defStyle) { int answer = defStyle; for(int i=0; i<attrs.getAttributeCount(); i++) { if(attrs.getAttributeNameResource(i) == android.R.attr.textAppearance) { String attrStringValue = attrs.getAttributeValue(i); if(attrStringValue !=

工具导航Map