w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
UIButton titleLabel NOT changing
Would your try [self.firstParameter setTitle:self.firstParameterString forState:UIControlStateNormal]; [self.firstParameter setTitle:self.firstParameterString forState:UIControlStateHighlighted]; [self.firstParameter setTitle:self.firstParameterString forState:UIControlStateDisabled]; [self.firstParameter setTitle:self.firstParameterString forState:UIControlStateSelected];

Categories : IOS

How to set the titleLabel.text of a UIButton?
You should not try to set the label text directly, but use UIButton setTitle:forState:: - (IBAction)changeTitle:(UIButton *)sender { [button setTitle:myString forState:UIControlStateNormal]; } The label property can be used to configure things like the font and other properties of the label, but some of them (color, shadow color and text) have to be set using the UIButton methods.

Categories : IOS

How can i change UIButton TitleLabel Element
try this one [back.titleLabel setAdjustsFontSizeToFitWidth:YES]; [back.titleLabel setNumberOfLines:1]; [back.titleLabel setLineBreakMode:NSLineBreakByCharWrapping]; you can change button title element using button set method.

Categories : C#

MvvmCross Bind to UIButton.TitleLabel.Text
For debugging issues, enabling trace may help - see MvvmCross Mvx.Trace usage For binding a property on a fixed pre-existing subcontrol of a subcontrol then this approach should work: set.Bind(sub.subSub).For(c => c.PropertyName).To(vm => vm.Foo); However, that won't continue to work if the sub control then changes its sub control at any point. For those cases, look at custom bindings - eg see http://slodge.blogspot.co.uk/2013/06/n28-custom-bindings-n1-days-of-mvvmcross.html For the specific case of a uibutton, you can just bind its "Title" - see Fluent Bindings and UIButton titles

Categories : C#

UIButton with multi-line titleLabel in InterfaceBuilder
Code: To allow multiple line you can use: button.titleLabel.lineBreakMode = UILineBreakModeWordWrap; button.titleLabel.textAlignment = UITextAlignmentCenter; [button setTitle: @"Line1 Line2" forState: UIControlStateNormal]; In iOS 6, UILineBreakModeWordWrap and UITextAlignmentCenter are deprecated, so use: button.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; button.titleLabel.textAlignment = NSTextAlignmentCenter; Interface Builder: In interface builder select UIButton on the right side Utilities pane under Attributes Inspector, you'll see an option for Line Break Choose Word Wrap

Categories : IOS

Changing text of UIButton titleLabel during alpha is 0.0f and avoid animation of text
Try like this : [UIView animateWithDuration:1.0 animations:^{ button.titleLabel.alpha:0.0f; } completion:^(BOOL finished){ button.titleLabel.text = @"Changed text"; } ]; [UIView animateWithDuration:1.0 animations:^{ button.titleLabel.alpha:1.0f; } ];

Categories : IOS

UIButton vertical alignment doesn't work
UIButton has a very nifty property named "titleEdgeInsets" which you can use (via UIEdgeInsetsMake to reposition the top and bottom margins of the title and get the thing centered, vertically.

Categories : IOS

DynamicReports stl.style().setFont(font)
Thanks for ricardo the site admin of DynamicReports Forum, He answered the question as below: You don't have to set java.awt font. What you need to do is to register a new font family name that will refer to font files that are located in the jar file. See the following link on how to create a new font family: http://www.dynamicreports.org/documentation/fonts The following link shows how to use the new font: http://www.dynamicreports.org/examples/fontsreport

Categories : Java

How to make a UIButton invisible but also still work if pressed?
You can try to custom type UIButton: UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; With empty title, empty background image. Or set the type from the storyboard or Interface Builder:

Categories : IOS

setFont() causing JFrame loading too slow , java
The problem of the components being "slow" to load is that they are not validated yet. The Window javadoc for setVisible method says: If the Window and/or its owner are not yet displayable, both are made displayable. The Window will be validated prior to being made visible. When you call setVisible(), all the components need to be validated. You can validate them before calling setVisible() calling pack() on the JFrame: frame.getContentPane().add(userTextField); frame.pack(); frame.setSize(100,100); frame.setVisible(true);

Categories : Java

TCPDF, using $pdf->SetFont('msmincho', '', 7); increases file size
By default, the complete font is being embedded in the PDF when you use it. A number of fonts can be used without having to specifically embed them in the PDF: courier : Courier courierB : Courier Bold courierBI : Courier Bold Italic courierI : Courier Italic helvetica : Helvetica helveticaB : Helvetica Bold helveticaBI : Helvetica Bold Italic helveticaI : Helvetica Italic symbol : Symbol times : Times New Roman timesB : Times New Roman Bold timesBI : Times New Roman Bold Italic timesI : Times New Roman Italic zapfdingbats : Zapf Dingbats You can embed only the characters that have been used, which should reduce the size of the PDF, by passing true as the fifth parameter of setFont. I don't know how much of a difference it will make but it should help a bit.

Categories : PHP

Why adding a subView to UIButton, from a custom UIView doesn't show the added subViews?
Your TWTimerView has a nib, in which you have a UIButton? And you have an UIView-Subclass, that is adding three UIImageViews to your UIButton, why you do this?! Why not subclass the UIButton and set the UIImageViews there? At all i would change it to this: @implementation TWTimerView - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code [[[NSBundle mainBundle] loadNibNamed:@"TimerView" owner:self options:nil] objectAtIndex:0]; self.backgroundColor = [UIColor clearColor]; _circle = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"circle"]]; _pointer = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pointer"]]; _tick =

Categories : IOS

UIButtons titleLabel clips Text after being rotated by CGAffineTransformMakeRotate()
OK, first of all, thanks to everyone who tried to help. Im posting an alternative solution for my problem, and although it doesnt really address the problem of changing the titleLabels dimensions, it will result in the proper display of my ViewController. It turns out using the frame is a bad idea. I initially used the frame to reposition the view and i figured that this couldnt be a problem because i only ever applied transformations afterwards, but i was wrong. Because OBVIOUSLY i tried to change the titleLabels frame. AFTER the rotation. And that didnt work. So the way to go here is using the center-property and the bouds of the view consistently throughout the code. It will result in properly rotated Buttons, that do not need any fidgeting afterwards. My takeaway here is that i will ne

Categories : Objective C

UIButton Highlighted State not showing when clicking over a Selected UIButton
The various states: UIControlStateNormal, UIControlStateSelected, and (UIControlStateSelected | UIControlStateHighlighted) are all actually distinct. If you want your shadowImage to apply both in the (only) highlighted state and in the highlighted+selected state, you must also set: [button setBackgroundImage:shadowImage forState:(UIControlStateHighlighted | UIControlStateSelected)]

Categories : IOS

UIButton added to UIButton not responding to selector
Your btnOnPopup is out of detailBtn's bounds so touches won't even get to it. Adding a button to a button is not really a great practice anyway. Adding it to a button's superview might be a little bit better (and will make your touches work, but you might need to adjust frame) [detailBtn.superview insertSubview:btnOnPopup aboveSubview:detailBtn];

Categories : IOS

RESTORE DATABASE doesn't work, and doesn't report any error
I think restore sometimes doesn't happen because the database being replaced is in use at that time. Try adding this before RESTORE DATABASE command: ALTER DATABASE [TestMLS] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

Categories : Sql Server

main program work good , but when put it into a function doesn't work pyQt
You aren't seeing any windows in the class based version because the function calls finalise and your PyQt objects are being garbage collected. In the simple first case you have, the variables containing your PyQt objects remain in scope for the duration. In this simple case, the easiest way to see this in action is store your PyQt objects in instance variables, ie. self.Frame and self.MainWindow to retain references to the object so that Python doesn't garbage collect them. Generally you would not work with PyQt in this fashion. You subclass the relevant object and do setup in the initialiser.

Categories : Python

Why shellcodes with jmp instruction work, and why doesn't the labels work inside a C wrapper?
The address of mesg can vary depending on how your program is laid out in memory. The following will hard-code a specific address and will not work reliably (or at all): mov ecx, mesg For reference, the first approach hard-codes the following address: mov ecx, 0x804807d The second approach does work because it figures out the address of mesg at runtime, using the return address of a call instruction. Put another way, the first version only works if loaded at a specific address whereas the second is position-independent. It is worth noting that the jmp and the call instructions that appear in the second version use relative addressing, meaning that the opcodes specify the distance to the target rather than the address of the target. This makes these instructions work regard

Categories : Assembly

Same url, work like reference to style, but doesn't work like AJAX call
The simplest answer will be to use a local web server like WAMP(or IIS) if you are not already. the second answer is Chrome and Safari has a restriction on using ajax with local resources. That's why it's throwing an error like Origin null is not allowed by Access-Control-Allow-Origin. Solution: Use firefox or upload your data to a temporary server. If you still want to use Chrome, start it with the below option; --allow-file-access-from-files More info how to add the above parameter to your Chrome: Right click the Chrome icon on your task bar, right click the Google Chrome on the pop-up window and click properties and add the above parameter inside the Target textbox under Shortcut tab. It will like as below; C:UsersXXX_USERAppDataLocalGoogleChromeApplicationchrome.exe --al

Categories : CSS

Why doesn't a DOM2"click" event work, when it does work for "mouseover"?
As far as i can tell the link <a id="workID" href="#">WORK</a> is not bound to a click event handler. In the screenshot you can see that you have set several events, but on click is not set. In your main.js you are calling the function showWorkPane() but in this function you define no event handler for onClick: function showWorkPane() { var workID = document.getElementById("workID"); workID.addEventListener("mouseover", showWorkPaneHandler, false); // add an event handler for click } To address your question: Why doesn't a DOM2“click” event work, when it does work for “mouseover”? Well you have to bind both events (click and mouseover). And currently i am looking into your code and it looks like that the eventhandler onmouseout which fires hideWorkP

Categories : Javascript

.htaccess redirect doesn't work on first load, but does work on refresh
Your rule is fine. It redirects for me in every browser. What's probably happening is that when you click on the link, your browser brings up a cached copy of the PDF. But when you explicitly reload the page, it sends the request to the server instead of pulling up a cached copy of the page and you see the redirect. If you want to test it again, clear your chrome cache and hit the link again.

Categories : Htaccess

Why does "except" work in filtering out IDs/rows, but "not in" doesn't work?
Would this be what you are trying to accomplish Select pm.patient_id from PatientMedication pm Where (pm.medicine_id = 11 or pm.medicine_id = 29) AND pm.start_date >= '2009-03-17'

Categories : Sql Server

Why doesn't CGContextShowGlyphsAtPositions() work, when CGContextShowGlyphsAtPoint() does work?
One possibility is this, from the CGContextShowGlyphsAtPositions document: The position of each glyph is specified in text space, and, as a consequence, is transformed through the text matrix to user space. The text matrix is a separate property of the context, distinct from the graphics state's current transformation matrix. It doesn't say that about CGContextShowGlyphsAtPoint: This function displays an array of glyphs at the specified position in the user space. (Emphasis added to both quotes.) So, your text matrix is not actually used when you show glyphs from a single point. But then, when you show glyphs at an array of positions, it is used, and you see the symptom of a wrong matrix. Specifically, your matrix to try to flip the text back the other way is wrong: it flips

Categories : Osx

Why doesn't my map work in IE8?
ArcGIS API for Javascript run at IE 8 and dojo run at IE 8 but there is a javascript code not run directly in IE 8 as Chrome and firefox you must write javascript code correctly to run at IE 8 and IE 8 can`t run this code : dojo.byId('details').innerHTML = content; this link help you to write correct code to run at IE 8 http://msdn.microsoft.com/en-us/library/ie/ms533897(v=vs.85).aspx

Categories : Javascript

Why doesn't ng-if work?
I confirmed the comment on angular's documentation about using the unstable branch by creating this fiddle: <!DOCTYPE html> <html class="no-js" ng-app> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js"></script> </head> <body> <p ng-if="1 == 0">True</p> {{1==0}} </html> here's the fiddle Running this fiddle results in the output you were expecting. Your code, but with the unstable build.

Categories : Angularjs

LESS really doesn't work
You can try the following workaround - start your .less file with valid CSS code, for example h1 {} and below put your LESS code: @color: #25d14d; h1 { color: @color; } I've faced the same problem and that helped me unexpectedly.

Categories : Visual Studio 2012

Why doesn't this BroadcastReceiver work?
move your BroadcastReceiver rec = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { WakeLock screenLock = ((PowerManager) getSystemService(POWER_SERVICE)) .newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "TAG"); screenLock.acquire(); } } }; under your oncreate public class SplashScreen extends SherlockActivity { PowerManager.WakeLock mWakeLock; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(com.sensounlock.R.layout.rotation); BroadcastReceiver rec = new BroadcastReceiver(

Categories : Java

Sub-query doesn't work
Your query should look like this: SELECT q.questao, r.resposta FROM questoes AS q JOIN respostas AS r ON r.id_quest = q.id_quest WHERE q.id_quest IN (19,20,21) AND r.r_valido = "1" Also I found out what is causing that weird error when you use 1 instead of "1" in the query: We strongly recommend that you do not use numbers as enumeration values, because it does not save on storage over the appropriate TINYINT or SMALLINT type, and it is easy to mix up the strings and the underlying number values (which might not be the same) if you quote the ENUM values incorrectly

Categories : PHP

My regex doesn't work
When you create a RegExp object from a string, you have to account for the fact that the string constant syntax, like the RegExp syntax, treats as a special character: alert(/^d{4}$/.test(obj.value)+" "+(new RegExp("^\d{4}$")).test(obj.value)); should work better. Note the \ in the string version instead of a single . What goes on when you've got something like var myRegExp = new RegExp( "blah blah d blah blah" ); ? First, the parser has to look at the low-lever parts of the expression, like the variable name, the = sign, the new, and so on. The string constant is one of those low-level basic elements of the expression. The parser has to turn that source code for a string into a runtime string value, and that involves reading the characters between the quotes. The d in there will

Categories : Javascript

Ruby .gets doesn't work
Here's how I understand it. gets and puts are instance methods of IO, and the default IOs are $stdout and $stdin. Calls to gets/puts will only be effective if the translator is capable of handling stdout/in e.g. IRB If you run a ruby file from bash it works too. io_test.rb puts gets in bash ruby io_test.rb Then it will "put" into stdout whatever it "gets" from stdin.

Categories : Ruby

removeExpiredCookie() doesn't work
CookieManager#.removeExpiredCookie() does the actual deletion on a separate thread. If you wait for a bit, or do a CookieSyncManager.sync() (which is also asynchronous), it might work. Another workaround suggests calling CookieManager.setCookie on all the cookies you want to remove, but that's only useful if you know the cookies and urls beforehand.

Categories : Android

Why doesn't the die() function work?
That's because die() only terminates/ends the PHP script. From an AJAX point of view the request was successful. You should echo the info in the PHP page and then output the content of the response in your AJAX. You could also set the response header in your PHP Script to something other than 200/OK, such as 401/Unauthorized or 400/Bad Request. Basically all 400 and 500 status codes indicate error.

Categories : PHP

fread doesn't work how it should
You are seeking to the start of the file, since you're setting the offset to 0. That doesn't sound like what you want to be doing, but on the other hand seeking to the end and then trying to read would also fail. I'm confused. :/ Could it be that you meant fwrite(), rather than `fread()? Not likely since the rest of the code prints the results after the I/O, which is logical for reading but not for writing. It would be helpful with more information, like your file is opened and what it does contain when you run the program.

Categories : C

Why doesn't cut work as expected in R?
Representation error. Floating point approximation of numbers is only exact if the number is a combination of certain powers of 2. Other numbers are mapped to these numbers. Different algorithms to produce a number may do so in different ways and have different errors associated with them (ie above or below the expected value). In this case: print(D$x,digits=22) [1] 0.5999999999999999777955 print(seq(0.5,0.7,0.025)[5],digits=22) [1] 0.5999999999999999777955 > print(seq(0.55,0.65,0.025)[3],digits=22) [1] 0.6000000000000000888178

Categories : R

CppUTest example doesn't work
The error you are getting is a linker error and it suggests that you are not linking the CppUTest library. It is hard to actually say what is wrong because your question is missing the Makefiles. Could you explain how you have compiled the example?

Categories : Osx

C List Pop doesn't work on first run
I just used your code with my implementation of GetOperations() and Print(). The code works fine. //Structure to represent node typedef struct node { char *data; struct node * next; } Node; //Pop top value from Linked list Node * Pop (Node ** head) { if (*head == NULL) { printf("Error popping! List is empty. "); return NULL; } Node * temp = *head; *head = (*head)->next; return temp; } //Create node and save data Node *createNode(int i) { char *n=malloc(sizeof(4*sizeof(char))); n[0]='O'; n[1]='p'; n[2]=(char)(((int)'0')+i); n[3]=''; Node *temp=(Node*)malloc(sizeof(struct node)); temp->data=n; temp->next=NULL; return temp; } //Create a list with data Node* GetOperations() { int i; Node *head=NULL,*curre

Categories : C

JQuery doesn't work?
Hi opening the site above with Google Chrome, got this errors: Uncaught TypeError: Object [object Object] has no method 'inFieldLabels' scripts.min.js:200 and also this font Failed to load resource the server responded with a status of 404 (Not Found) http://alanbrandt.com/wp-content/themes/alanbrandt/fonts/bryantpro-medium-webfont.woff there are more conglicts between this plugin and other frameworks, for example: In-field labels plugin not working and also maybe relevant Using Google JSAPI breaks my infieldlabel javascript, why and how do I fix it? in the last its suggested the use of $j = jQuery.noConflict(); check what frameworks you have installed and any conflicts with this plugin hope it helps

Categories : Jquery

Why doesn´t indexOf work?
Just because you have two Ticket objects that contain the exact same values, does not mean these two objects are equal. This is why the indexOf returns -1 every time -- because the ticketCollection observable array does NOT contain the exact item you are checking for. This SO question has a good explanation of JavaScript object equality: How do you determine equality for two JavaScript objects? Instead of using the indexOf on the array, you should instead check to see if any item in your ticketCollection matches BOTH the ticketName and the cost of the new, incoming Ticket. I'll add an example of what I mean: for(var i=0, len=self.ticketCollection().length; i < len; i++){ if ((t.ticketname() === ticketCollection()[i].ticketname()) && (t.cost() === ticketCollection()[i].cost()

Categories : Knockout Js

Why this qsort() doesn't work?
If this is all the code you have related to the qsort, it looks like you declared the comparePtr function pointer, but it's still not initialized; it's not pointing to your compare function (which is what I assume you wanted it to point to). After that, a few more things: 1) comparePtr has the correct types, but compare does not. It needs to take in two const void*, but you have two const void**. 2) Once you fix the types, you could just pass compare to qsort, instead of making a function pointer and passing that. 3) I'm not convinced the first argument to qsort is correct. You want to be passing in the pointer to the first element in the array, which ought to just be fileList (I'm assuming it points to the first string in your array). 4) The third argument isn't correct either. fileLis

Categories : C

CSS code doesn't work
You need to add width and height in your css .ToolKitStyle{ background-color: #2EC0FE; -moz-border-radius: 34px; -webkit-border-radius: 34px; border-radius: 34px; -moz-box-shadow:inset 0px 4px 9px rgba(0,0,0,1); -webkit-box-shadow:inset 0px 4px 9px rgba(0,0,0,1); box-shadow:inset 0px 4px 9px rgba(0,0,0,1); background-image: -o-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%); background-image: -moz-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%); background-image: -webkit-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%); background-image: -ms-linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%); background-image: linear-gradient(90deg , rgb(0,4,5) 0%, rgb(246,107,255) 100%); width:100px;

Categories : HTML



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.