styles

WPF custom derived control style

妖精的绣舞 提交于 2019-12-30 06:09:11
问题 I have a custom control derived from Button: class MyControl : Button{} And suppose, this class is empty (has no members). In the application's main window resources I use ResourceDictionary that contains styles for most WPF controls (so called theme): <ResourceDictionary Source="BureauBlue.xaml" /> So, all controls on the window look like it is defined in that theme file. But the styles are not affected on MyControl controls. How can I do MyControl to look same as a Button controls? Update:

Setting Button's Content to <Image> via Styles

♀尐吖头ヾ 提交于 2019-12-30 04:41:07
问题 Can't get this to work: <UserControl> <UserControl.Resources> <ResourceDictionary> <Style x:Key="TestStyle" TargetType="{x:Type Button}"> <Setter Property="Button.Content"> <Setter.Value> <Image Source="D:\Temp\dictionary16.png"/> </Setter.Value> </Setter> </Style> </ResourceDictionary> </UserControl.Resources> <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left"> <Button Style="{StaticResource TestStyle}"/> <Button Style="{StaticResource TestStyle}"/> </StackPanel> </UserControl>

How to change color of the bubble (under cursor) on EditText (programmatically)?

随声附和 提交于 2019-12-30 03:48:07
问题 I have EditText and want to change color PROGRAMMATICALLY on code . To change color of cursor I use this code. But how to change color of the circle on EditView PROGRAMMATICALLY on code ? 回答1: You will need to use reflection to tint the select handles (bubbles). I wrote the following class this morning: Example usage: try { EditTextTint.applyColor(editText, Color.CYAN); } catch (EditTextTint.EditTextTintError e) { e.printStackTrace(); } EditTextTint.java : import android.content.res.Resources

Writing themed applications in Android

ⅰ亾dé卋堺 提交于 2019-12-30 02:30:07
问题 I am writing an application in Android and want users to be able to download themes and/or create ones themselves. The app would come with some default images and either themes could be installed from Market/as other APKs or could be put on sdcard - either would be fine. What I want is: - allow themes to override images in buttons - right now I have XML styles to do things like highlighting when selected ( for button background + for combining button bg with actual button images) - allow

reset multiple css styles for one single div element

╄→尐↘猪︶ㄣ 提交于 2019-12-30 00:58:47
问题 my question is if it is possible to reset css styles (a lot off them) for a single div and all elements that are contained in that div. I am asking, because I found this tutorial for a jquery shoutbox that has it's own css file. I can not just copy the styles over to my own css file, because it will screw up the rest off the page where the styles are already set. I thought off using a divwrapper and apply all those resets only to that one. I am just not sure if it's possible I only know this

Android: Theme Holo previous version

你说的曾经没有我的故事 提交于 2019-12-29 14:56:14
问题 I really like the 4.0 ICS Holo Light theme and would like to have it in my app to support <4.0 smartphones. I found Android layoutlib.jar in platform folder but its 8mb!!! and I really don't have afford to increase my app with 8mb. Any tip? //Pew Labs PS ive tried https://github.com/ChristopheVersieux/HoloEverywhere but it doesnt support TabVIew which I use Thanks! 回答1: It would be better not to use the Holo theme on unsupported devices. You can do a simple trick to make your app run the Holo

How/Where to Find Microsoft Default Styles for WPF Controls

我只是一个虾纸丫 提交于 2019-12-29 06:18:04
问题 I am looking to change the style of a control but I basically want to copy part of a default style. Does anyone know how I can figure out what the default style of a control is? In my case I am wanting to make the column headers in a DataGrid go blue on mouse over like the row headers do. 回答1: You can find some templates that are very close to the defaults on this MSDN site Another alternative is to get a copy of Expression Blend and use it to make a copy of the default style, however Blend

Custom cursor color in SearchView

☆樱花仙子☆ 提交于 2019-12-29 00:25:31
问题 I want to change the color of the blinking cursor in a SearchView in the Actionbar (I'm using Actionbar Sherlock for compatibility). Until now I've managed to change the color of the cursor for a EditText element. This SO post helped me to accomplish that and the style I'm using for the EditText looks like this: <style name="CustomTheme" parent="Theme.Sherlock.Light"> <item name="android:editTextStyle">@style/edittext_style</item> </style> <style name="edittext_style" parent="@android:style

“You need to use a Theme.AppCompat theme (or descendant) with the design library” error

霸气de小男生 提交于 2019-12-28 18:09:50
问题 I'm getting "You need to use a Theme.AppCompat theme (or descendant) with the design library" error every time even if I'm obviously using an AppCompat Theme (a descendant one). dependencies: compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:design:23.3.0' compile 'com.android.support:support-v4:23.3.0' layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns

Grow height of parent div that contains floating nested divs

こ雲淡風輕ζ 提交于 2019-12-28 10:46:59
问题 I can’t seem to auto-grow my parent div ’s height based on its floating child div s. All the children are floating, to take up space horizontally, and then wrapping to the next line. There can be a changing number of floating children, and the parent has to auto-size its height. (The parent div serves as a background for all the floating div s). There is also a second div below the parent div that needs to be pushed down, so that it is below the floating div s. It’s of major importance that