How to customize UISwitch button in iphone?

You can not modify UISwitch control unless and until you write your own control, But best way so far, you can used UISegmentControl and handle event on it to switch the on.png and off.png images. UISegmentedControl* switchView=[[UISegmentedControl alloc] initWithItems:[[[NSMutableArray alloc] initWithObjects:@”On”,@”Off”,nil] autorelease]]; [switchView setFrame:CGRectMake(20,365,140,28)]; switchView.selectedSegmentIndex=0; switchView.segmentedControlStyle=UISegmentedControlStyleBar; [switchView setImage:[UIImage imageNamed:@”onSelected.png”] forSegmentAtIndex:0]; [switchView setImage:[UIImage imageNamed:@”off.png”] forSegmentAtIndex:1]; [switchView … Read more

How to use bootstrap with 16 or 24 columns

This method is for an older version of Bootstrap – Version 2.3.1 Click this link to customize bootstrap: http://twitter.github.com/bootstrap/customize.html You will find examples such as this. Change the parameters to fit your needs. 16 Grid system with Gutter @gridColumns: 16 @gridColumnWidth: 45px @gridGutterWidth: 15px @gridColumnWidth1200: 52.5px @gridGutterWidth1200: 22.5px @gridColumnWidth768: 31.5px @gridGutterWidth768: 15px 16 Grid system … Read more

How to customize / style a UIPopoverController

This is possible starting in iOS 5.0 by subclassing the abstract class UIPopoverBackgroundView and assigning your subclass to the popoverBackgroundViewClass property on your UIPopoverController instance. Unfortunately there is no tintColor property as the popover needs to use images for it’s arrow and border in order to achieve smooth animations during dynamic resizing. You can learn … Read more

Keycloak retrieve custom attributes to KeycloakPrincipal

To add custom attributes you need to do three things: Add attributes to admin console Add claim mapping Access claims The first one is explained pretty good here: https://www.keycloak.org/docs/latest/server_admin/index.html#user-attributes Add claim mapping: Open the admin console of your realm. Go to Clients and open your client This only works for Settings > Access Type confidential … Read more

Android toggle button custom look

create toggle_selector.xml in res/drawable <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:drawable=”@drawable/toggle_on” android:state_checked=”true”/> <item android:drawable=”@drawable/toggle_off” android:state_checked=”false”/> </selector> apply the selector to your toggle button <ToggleButton android:id=”@+id/chkState” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:background=”@drawable/toggle_selector” android:textOff=”” android:textOn=””/> Note: for removing the text i used following in above code textOff=”” textOn=””

How to customize title bar and window of desktop application

######################################################### ## customize Title bar ## dotpy.ir ## [email protected] ######################################################### import sys from PyQt4 import QtGui from PyQt4 import QtCore from PyQt4.QtCore import Qt class TitleBar(QtGui.QDialog): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setWindowFlags(Qt.FramelessWindowHint); css = “”” QWidget{ Background: #AA00AA; color:white; font:12px bold; font-weight:bold; border-radius: 1px; height: 11px; } QDialog{ Background-image:url(‘img/titlebar bg.png’); font-size:12px; color: black; } QToolButton{ … Read more