inherit style from default style

Use the type of the control you would like to extend BasedOn=”{StaticResource {x:Type TextBox}}” Full example: <Style x:Key=”NamedStyle” TargetType=”TextBox” BasedOn=”{StaticResource {x:Type TextBox}}”> <Setter property=”Opacity” value=”0.5″ /> </Style>

Android multi color in one TextView [duplicate]

You can use Spannable to achieve what you want. String text = “This is <font color=”red”>red</font>. This is <font color=”blue”>blue</font>.”; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { textView.setText(Html.fromHtml(text, Html.FROM_HTML_MODE_LEGACY), TextView.BufferType.SPANNABLE); } else { textView.setText(Html.fromHtml(text), TextView.BufferType.SPANNABLE); }

Best CSS color wheel sites [closed]

Adobe’s Kuler – http://kuler.adobe.com/ is widely considered to be the best color palette selector out there, as it also lets you share color palettes other users have created. Sign in, click create, and you’ll have options including “complementary” that give you a good starting point if you have one color in mind.

Android 4.0 Sub-Title (section) Label Styling [closed]

So this is what I ended up using: <?xml version=”1.0″ encoding=”utf-8″?> <resources xmlns:android=”http://schemas.android.com/apk/res/android”> <style name=”sectionHeader” parent=”android:Widget.Holo.Light.TextView”> <item name=”android:drawableBottom”>@drawable/section_header</item> <item name=”android:drawablePadding”>4dp</item> <item name=”android:layout_marginTop”>8dp</item> <item name=”android:paddingLeft”>4dp</item> <item name=”android:textAllCaps”>true</item> <item name=”android:textColor”>@color/emphasis</item> <item name=”android:textSize”>14sp</item> </style> </resources> Where @drawable/section_header is: <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <size android:width=”1000dp” android:height=”2dp” /> <solid android:color=”@color/emphasis”/> </shape> And @color’s: <?xml version=”1.0″ encoding=”utf-8″?> <resources> <color … Read more

Set a padding on dataGridCells in WPF

The problem is that the Padding isn’t transfered to the Border that’s in the Template for DataGridCell. You can edit the Template and add the TemplateBinding for Padding <DataGrid …> <DataGrid.CellStyle> <Style TargetType=”DataGridCell”> <Setter Property=”Padding” Value=”20″/> <Setter Property=”Template”> <Setter.Value> <ControlTemplate TargetType=”{x:Type DataGridCell}”> <Border Padding=”{TemplateBinding Padding}” BorderBrush=”{TemplateBinding BorderBrush}” BorderThickness=”{TemplateBinding BorderThickness}” Background=”{TemplateBinding Background}” SnapsToDevicePixels=”True”> <ContentPresenter SnapsToDevicePixels=”{TemplateBinding SnapsToDevicePixels}”/> … Read more

How can I style an Android Switch?

You can define the drawables that are used for the background, and the switcher part like this: <Switch android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:thumb=”@drawable/switch_thumb” android:track=”@drawable/switch_bg” /> Now you need to create a selector that defines the different states for the switcher drawable. Here the copies from the Android sources: <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:state_enabled=”false” android:drawable=”@drawable/switch_thumb_disabled_holo_light” /> <item android:state_pressed=”true” android:drawable=”@drawable/switch_thumb_pressed_holo_light” … Read more