How can I set the border radius of logo image in the ToolbarAndroid component?
I know it can't be styled by style property.
You need to do two steps:
create custom Toolbar layout with - it' only example - ImageView and TextView
make an ImageView coreners rounded. Check: How to make an ImageView with rounded corners?
replace original one with this. Check: Creating a custom toolbar in android
Hope help
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.
I want to make FAB Button in triangular shape, But usually FAB is in circle shape. How will I achieve it.
Try like this:
take triangular shape Drawable and add it
app:backgroundTint should be "null"
I haven't try this yet, but this is my idea. What if you:
make transparent to background color of button using property
background or background-tint
add triangle image using property src
However, we are not suggested to change the shape of the button. Look this: Float Action Button
Hi guys I am new to Android .I want to make the layout given in the image.
I want to achieve the effect inside the red box.How can I make the background opaque while its keep its child opaque?
I tried this as,
The part inside the red box as RelativeLayout, which has a TextView (value as Contact details) I gave android:alpha=0.3 for relative layout,but the problem is,it makes the TextView also opaque (which is logical)
I just want some thoughts to move in that direction.
Create a color resource with an alpha component of 0.3 and set it as the background of the RelativeLayout
In the colors.xml
<color name="opaque_black">#4c000000</color>
In the layout of the View
<RelativeLayout
...
android:background="#color/opaque_black"
...>
I have an activity in android and I want to add a fragment which would appear as in the image below. I want it to have the shape shown and be semi-transparent so that the activity can be seen in the background. Two questions : 1) How do I set the shape of a framelayout? I assume I define the shape in XML and save it as a XML file but which attribute do I use to set the frame layout to have that shape. 2) how do I make the fragment semi transparent, I assume I would use a semi transparent color as the background, but I am not sure.
For transparency, use alpha=" (float) value" on your fragment layout (container) in your activity_main.xml.
For rounded corners check this solution this solution, adding background also on fragment layout container. Also apply padding to this container.
I need xml styles for tab on or off state,whenever i click the button,display rounded rectangle on button.How can i make new style for given image.please give some tips for me
how to create styles for rounded rectangle like this image
For that add rounded cornered images as a background to tab:
tab = tabs.newTabSpec("tab_Busquedas");
tab.setContent(new Intent().setClassName("com.grapp", "com.grapp.homes").putExtras(bundle));
tab.setIndicator(null,null);
tabs.addTab(tab);
//here you set the image with rounded corners over the tab.
tabs.getTabWidget().getChildAt(0).setBackgroundResource(R.drawable.mytab_roundedcorners);
This solution is posted at: How to achieve rounded tabs in Android 2.1 +
You can make use of the themes feature for the same.
http://developer.android.com/guide/topics/ui/themes.html
If you make use of this feature, maintainability will also be easy.
Regards,
SSuman185