customization

Creating a fully customized NSAlert

泪湿孤枕 提交于 2019-11-28 12:22:14
Is it possible to create a fully customized alert? I'm doing it with custom sheets now, but I'd like to have the feature that the sheet is blocking (like -[NSAlert runModal] ). I just want to change the background, really, and the text color, of course. Warning about the recommended solution: This code causes wasteful and pointless overhead: for (;;) { if ([NSApp runModalSession:session] != NSRunContinuesResponse) break; } This code is copied straight from the Apple documentation page - but it's meant to show the developer where meaningful code can be inserted for background execution while

Customize the More UIBarButtonItem in UITabBar

一个人想着一个人 提交于 2019-11-28 11:51:00
Since iOS 5 Apple provided an API to customise the UITabBarItems in the UITabBar object. I am refering specifically to the following selector: setFinishedSelectedImage:withFinishedUnselectedImage: It all works great for regular buttons but I can't seem to customise the "More" button to match the style of the other ones. This is what I am doing: tabBarController.viewControllers = tabBarControllerArray; tabBarController.moreNavigationController.navigationBar.tintColor = [UIColor blackColor]; UITabBarItem *more = tabBarController.moreNavigationController.tabBarItem; if ([more respondsToSelector:

Android - Prevent text truncation in SearchView suggestions?

℡╲_俬逩灬. 提交于 2019-11-28 11:21:44
The suggestions that appear in the default ListView beneath my SearchView contain text that is truncated. I would like the text to be displayed in its entirety (on multiple lines if necessary). I have come up with two possible ways to solve this but, with no examples to be found on the net, I was hoping someone on here may be able to help... Approach #1 / Q1: How can I directly access and modify the appearance of the TextViews that hold the SUGGEST_COLUMN_TEXT_1 and SUGGEST_COLUMN_TEXT_1 text? Approach #2 / Q2: Alternatively, SearchView has a setSuggestionsAdapter(CursorAdapter adapter) method

How to set size of swing components

僤鯓⒐⒋嵵緔 提交于 2019-11-28 11:18:46
问题 I want to customize the height and width of the JTextField objects. I have tried with the setSize method, passing width and height as dimensions and as int as well. But none of them seems to work. Am I missing something, like some mandatory method call on the panel or something so that the size customization would be effective? Please help. Thanks in advance. EDIT: Here is a bit of the code: public class WestPanel extends JPanel{ private JLabel dateL; private JTextField date; public WestPanel

How to get a random value from 1~N but excluding several specific values in PHP?

我们两清 提交于 2019-11-28 10:19:24
rand(1,N) but excluding array(a,b,c,..) , is there already a built-in function that I don't know or do I have to implement it myself(how?) ? UPDATE The qualified solution should have gold performance whether the size of the excluded array is big or not. No built-in function, but you could do this: function randWithout($from, $to, array $exceptions) { sort($exceptions); // lets us use break; in the foreach reliably $number = rand($from, $to - count($exceptions)); // or mt_rand() foreach ($exceptions as $exception) { if ($number >= $exception) { $number++; // make up for the gap } else /*if (

Android custom animation like airport schedule board

淺唱寂寞╮ 提交于 2019-11-28 09:24:26
I want to create an animation for the text like on Airport the flight schedule board does. Dropping from top and change the text on it. Here is the image. So When I click on button the text on the image should change with the said animation. Does it possible with android? Please guide me how can I achieve this kind of animation in android? EDIT: <?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/clockbg1" android:duration="150" /> <item android:drawable="@drawable/clockbg2"

Can you create functions with custom prototypes in JavaScript?

你离开我真会死。 提交于 2019-11-28 09:13:23
First of all, I don't want to add methods to Function.prototype . Doing that would make them available for all functions and that's not what I'm looking for. In JavaScript you can create objects with custom prototypes like this: function CustomObj() {} CustomObj.prototype = {}; CustomObj.prototype.sayFoo = function () { return 'foo' }; var myCustomObj = new CustomObj(); //=> returns an object: {} myCusomObj.sayFoo(); //=> 'foo' You can also create array-like objects with custom prototypes like this: function CustomArr() {} CustomArr.prototype = []; CustomObj.prototype.sayFoo = function () {

Create custom keyboard and configure it on your iPhone

ⅰ亾dé卋堺 提交于 2019-11-28 07:50:44
I am working on creating custom keyboardas presented by EMOJI with having characters and pictorial icons like smileys and other day to day used symbols.So far i came to know that these symbols have unicode standards that are added to Unicode Consortium and approved by Apple. http://itunes.apple.com/us/app/emoji-free!/id332509635?mt=8 I need help regarding the process these symbols are registered. Is it possible to make the keyboard compatible for text inputting in all the apps installed on iphone if so How to proceed ?. NOTE:Are these keyboards approved by apple or apps with them gets rejected

How to change background of all VIEWS in Eclipse IDE? [duplicate]

谁说胖子不能爱 提交于 2019-11-28 07:34:14
This question already has an answer here: Eclipse IDE for Java - Full Dark Theme 19 answers I would like to get a dark look for Eclipse IDE (Aptana). I changed background color of code editors and other colors. But i can't figure out, how to change background color of all views ... In Window -> Prefenreces -> Appearance -> Colors and Fonts i can tweak only few views (Plugin Manager, Script view, file view) but not all. Is there a way to do it ? What configuration files should i edit ? VonC Update July 2012 (31 months later): With the latest Eclipse4.2 (June 2012, "Juno") release, you won't

Plural String Formatting

六月ゝ 毕业季﹏ 提交于 2019-11-28 07:27:53
Given a dictionary of int s, I'm trying to format a string with each number, and a pluralization of the item. Sample input dict : data = {'tree': 1, 'bush': 2, 'flower': 3, 'cactus': 0} Sample output str : 'My garden has 1 tree, 2 bushes, 3 flowers, and 0 cacti' It needs to work with an arbitrary format string. The best solution I've come up with is a PluralItem class to store two attributes, n (the original value), and s (the string 's' if plural, empty string '' if not). Subclassed for different pluralization methods class PluralItem(object): def __init__(self, num): self.n = num self._get_s