How to add the trianle shape with corner on layout like popular.
You can display the Popular text as an image view or You can use this library to display the text from TextView
You can modify the properties like corner,labelPadding,primaryText,primaryTextColor
https://github.com/shts/TriangleLabelView
Related
I need to add a scrollable android TextView, which will show alot of text.
I want to achieve this kind of effect:
But I found no way of doing so.
Is there any good way of doing it?
Thank you!
try below properties to TextView
android:requiresFadingEdge="vertical"
android:fadingEdgeLength="32dp" //To change the gradient overlay height
The most convient way of doing this is creating a drawable. You can either make your own image in the image editing software of your choice or create a GradientDrawable. Make sure the colors go from white to transparent. Then place this drawable on top of the textview near the bottom.
As you see in the picture there is text in the AppCompatTextView left design view.
To the right in setting pan I clearly set the text like:
android:text="some text"
Any ide?
You should TextView instead of AppCompatTextView.
From the documentation:
This will automatically be used when you use TextView in your layouts and the top-level activity / dialog is provided by appcompat. You should only need to manually use this class when writing custom views.
The TextView icon is not a Compound Drawable since the bottom line doesnt cover it.
How to define a layout like this where beside each text is an icon?
I just see ugly to add so much ViewGroups in the same view just to have the icon because there will be a lot of text input in the view.
use drawableLeft property of textview to set an icon with your text, it will create a single view with your icon and your text.
android:drawableLeft="#drawable/icon"
android:drawableBottom="#drawable/icon_line"
This is the label of my activity in the actionbar with "Show layout bounds" option enabled.
As you can see the label area is centered, but the text inside it is moved to bottom. So it appears like the text is not centered.
How to center the text vertically?
You should provide some additional information like the definition of the layout.xml file.
this image show the default implementation of check box in android.
In this image check box is centre to the text. I want it to the top. what should i do?
I used Relative layout. In <TextView> i used the following code for top padding and my problem gets solved. :)
android:layout_marginTop="6dip"
Have a custom 9-patch checkbox button with the stretchable portion defined at the bottom.. so the actual checkbox will be at the top and the rest space will be filled with transparency