w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How do I make a constraint to position my label from the top, but not have it move when I hide the navigation bar (as it adjusts height of view)?
Why not use the navigation bar height (self.navigationController.navigationBar.frame.size.height), and move the UILabel up/down depending on whether the navigation bar is hidden / visible? This way, you're not hardcoding anything and you're working off of the UINavigationBar properties.

Categories : IOS

attempt to present a view whose view is not in the window both with segues and programmatically
Don't do this in viewDidLoad, your view isn't on screen yet, so that's why you get that error. You should do it in viewDidAppear (with no animation if you don't want to see the view of the controller that this code is in).

Categories : IOS

Moving subviews from one view to another view without changing any position information in storyboard?
Yes there is an easy way to do this: Step 1: Select your views Step 2: Go Editor > Embed In > Scroll View Done! PS. This is a very handy way to group views in fact. You can embed any views into a 'container' view, move it wherever you like (even cross-scene) retaining relative position information and then you could keep it as a group or unembed them.

Categories : Iphone

Scroll position in Text View object on detail view doesn't reset when returning
Since you are reusing a HardlyWorkingDogsDetailViewController, this behavior makes sense. If HardlyWorkingDogsDetailViewController is light weight enough, there really isn't any need to reuse it. Simply reinstantiating it everytime should fix your problem: self.detailViewController = [[HardlyWorkingDogsDetailViewController alloc] initWithNibName:@"HardlyWorkingDogsDetailViewController" bundle:nil ]; Dog *dog = self.sortedDogDictionaryArray[indexPath.row]; self.detailViewController.dogName= dog.dogName; self.detailViewController.dogLicense = dog.licenseString; self.detailViewController.dogScrollingInfo = dog.whatMakesDogSpecial; self.detailViewController.dogPhoto = dog.dogPhoto; [self.navigationController pushViewController:self.detailViewController animated:YES]; Although, having not

Categories : Iphone

Android notifydatasetchange() creates new view while needed update in view with layout position maintain
When calling notifydatasetchange() on the two adapters, first for the scrollView look here : Android setting position of hortizontal scrollview For the listview you can look here Maintain/Save/Restore scroll position when returning to a ListView just save your position before calling notifydatasetchange() good luck

Categories : Android

how to make a view not programmatically as cameraoverlay view
There are several approaches that will work Create a custom conainer view in code. Add the zbar view, and any custom views (scanner graphics, etc on top). This is what i recently did. Create a xib-baased view, and include the zbar view in that. See the 'object' component. Load custom views from xibs and add them. If you have the time, I recommend you invest to learn how to create views programmatically. This involves: in your view contoller override the loadView method. return a custom sub-class of UIView that contains sub-views. These include the zbar view and your overlays. learn how to use the layoutSubviews method on UIView. Hint set your child view's frame relative to thecparent views bounds. There are loads of custom components on Github. Check out DCSwitch or CMPoptip,

Categories : Objective C

how to Move world view instead of camera view
Create a virtual Camera Boom. Create an invisible object like a TDummy, in the same location as the object of interest or the center of the scene. Create the TCamera as a child of the object. Set its position the desired distance away on one of the axes. you can now rotate the camera around the object simply by changing the rotationAngle of the dummy object. The camera will maintain the exact distance and automatically points directly toward the center. Also by adding light as a child of the camera it too will follow as the camera moves. Hope this helps someone.

Categories : Delphi

Android view animation looses position of view
This is because your are animating the "y" property while trying to read the property top, and they aren't the same. Top is the top position of the view relative to its parent. Y is the visual y position of the view which is equivalent to translationY + the current top property. So in your case: Either animate "top" like this: ObjectAnimator animHandle = ObjectAnimator.ofFloat(mHandleContainer, "top", 200); And read it via mHandleContainer.getTop() Or "y": ObjectAnimator animHandle = ObjectAnimator.ofFloat(mHandleContainer, "y", 200); And read it via mHandleContainer.getY();

Categories : Android

How to position a child view relative to containing view size?
You can't use top and height in the same constraint. Although it makes sense to say it the system doesn't like it. What you could do instead is something like... NSLayoutConstraint *topPositionConstraint = [NSLayoutConstraint constraintWithItem:_childView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_containerView attribute:NSLayoutAttributeTop multiplier:1.0 constant:_containerView.frame.size.height * 0.25];

Categories : IOS

Toggle between big view and normal view for android notification programmatically by using notification action button
No, you have no control on that part. It is handled by the system and before Android 4.1 you wouldn't haven get the "big view". You are using notifications for something that they aren't supposed to be used. If the user chose to swipe away your notification he is not interested in the notification and you can't do anything about it. An user may also decide to stop your app for issuing notifications. You can't rely on the notification for things like this. If you explain exactly what your flow is I may be more helpful.

Categories : Android

How to get event touch move of UIView when move finger from outside view
Best approach is create a uiview with necessary size(which is larger than uiimageview). Place the uiimageview inside it. Add gesture recognizer to uiview instead of uiimageview. In the delegate method of geature, move the image view.

Categories : IOS

Eclipse: Problems View: Warnings: Eclipse Not Seeing JSTL libraries
You have to add your jstl jars to the project's classpath in eclipse. Look here (http://stackoverflow.com/tags/jstl/info) to choose the right jar set according to your configuration.

Categories : Eclipse

What is this Eclipse view and how to implement it in other Eclipse-based products?
this window is called JavaDoc View http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fviews%2Fref-view-javadoc.htm any developer that uses the eclipse IDE knows this windows, it's shown the javadoc content of selected element, it's part of Eclipse Java development tools (JDT)

Categories : Eclipse

Strongly Attributed Property in Master View Becomes Null After Callback Delegation from Detail View in Split View Controller
Based on the comment conversation under the question one possibility is that inconsistent variable naming might be the problem. It looks like you might have "@synthesize idSearchBar = searchBar;" in your implementation so self.idSearchBar and searchBar are effectively the same thing. The problem with this is a local variable called searchBar somewhere else in your class could overwrite your instance variable. So try this: Change the synthesize line to "@synthesize idSearchBar = _idSearchBar;" or remove the @synthesize line completely and let the compiler auto-generate that exact line for you (if using LLVM compiler 4.0). Change all searchBar usage that show up as an error to "self.idSearchBar" to be consistent throughout your class. Any leftover uses of searchBar will be local variables

Categories : IOS

What would be more efficient to load content on a detail view from a view controller with a table view?
It's not totally clear from your question where the data is coming from. I'm assuming because you mention a JSON call that when you select an item on your table view you need to make a web service call to fetch additional information about that item before displaying your detail view. If that's the case then you should make the web service call and load the data whilst in the detail view controller. Apple's interface guidelines recommend you do it this way to give the appearance of responsiveness. The detail view controller will be displayed immediately after the row in the table view has been tapped. You can use an activity indicator or loading graphic in your detail view to let the user know additional information is being downloaded. This is a considerably better experience than waiti

Categories : Iphone

Create custom UI bar button (to change view from list view, grid view)
It is UISegmentedControl not UIButton UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] init]; [segmentedControl insertSegmentWithImage:[UIImage imageNamed:@"0.png"] atIndex:0 animated:NO]; [segmentedControl insertSegmentWithImage:[UIImage imageNamed:@"1.png"] atIndex:1 animated:NO]; UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:segmentedControl]; [[[self navigationController] navigationItem] setRightBarButtonItem:barButtonItem];

Categories : IOS

MySql VIEW ERROR 'View 'tablet_001.hisrec' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them'
SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = 'tablet_001' AND TABLE_NAME = 'hisrec'; Check out your view and see what is the problem,if you don't know post it here.

Categories : Mysql

my UINavigatioBar is not on the top of view - programmatically
Put this code to ViewWillAppear - (void)viewWillAppear { UINavigationController *navigationController = [[UINavigationController alloc] init]; [view addSubview: navigationController.view]; } Also you should resize nav controller to self controller bouns

Categories : IOS

iOS Programmatically Creating a View
- (void)showBanner { UIView *newView = [[UIView alloc] initWithFrame:self.view.bounds]; newView.backgroundColor = [UIColor grayColor]; [self.view addSubview:newView]; [newView performSelector:@selector(removeFromSuperView) withObject:nil afterDelay:5.0f]; } Very preliminary, but should work

Categories : IOS

Set negative margin on View programmatically
Access the layout params for your parent layout and modify them as you like: ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams)view.getLayoutParams(); params.topMargin = ...; // etc // or params.setMargins(...); After you've modified the layout, call view.requestLayout().

Categories : Android

Programmatically adding view controllers, too many?
Try to use multiple instances of a handful of ViewControllers. Everything can be configured accordingly based on your data model. Most of your modal VCs and tables VCs will be reusable. You may end with a dozen VCs total or perhaps a bit more but that's fine initially - with inheritance and protocols you will be able to achieve a high degree of code reusability. Take a look at the sample apps over at apple dev and read the basics. I wouldn't worry too much about style or neatness for now. Just finish that first version.

Categories : Iphone

OnRestoreInstanceState() not applied on View IDs that have been set programmatically
Edit: There was a race condition in my code. After ensuring that I have a unique ID, it worked perfectly. It seemed to me that (for some odd reason), an ID of less than 10 would return incorrect instance data (possibly from another view) to the OnRestoreInstanceState() of the ViewPager. Really weird since I used FindViewByID prior to setting the ID to ensure that the ID was unique. But, there could be a race condition or something that I'm missing. Anyways, setting the ID to 10 or greater gave the correct behavior, and the position of the ViewPager persists between orientation change.

Categories : Android

Programmatically displaying Storyboard view
By the way, I know you've solved your issue, but I just wanted to suggest another flow. You could, alternatively, always start with your standard initial scene (which you can do without any code in the app delegate), but have its viewWillAppear determine if you need the terms and conditions (T&C), and if so, present that separate scene modally (either animated or not animated, as you see fit). You can have the user's confirmation of the T&C then dismiss the terms and conditions scene and you'll be back at the standard "initial" scene. If you do it that way, your T&C will be dismissed, you don't have to play around with changing the rootViewController programmatically, the top level scene of the navigation controller always stays as the standard "initial" scene so things like

Categories : Iphone

Add multiple NSSlider to view programmatically
Your first for statement is totally wrong: for (int i = 0; i<5; i = i+30) It will enter the loop only once. That's probably why you're not getting all the sliders you want.

Categories : Objective C

How to move to second view programatically in ios app?
remember to import the secondView, and in storyboard you have to give the identifier "SecondView" to secondViewController if ([[NSUserDefaults standardUserDefaults]boolForKey:@"Yes"]) { SecondViewController *sv = (SecondViewController *)[self.storyboard istantiateViewControllerWithIdentifier:@"SecondView"]; sv.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentViewController:sv animated:YES completion:Nil]; }

Categories : IOS

android - can not setvisiblity view.invisible for view with default view.gone
This is probably because in your parent layout you have android:layout_width="wrap_content" either change this to android:layout_width="match_parent" or a fixed width, which I don't recommend. Or change the visibility of the View to invisible instead of gone in your xml. When the layout is first drawn, that space isn't available with the properties you have set. With my recommendations, the space will still be there to be used by another View. You could also change the width of the parent layout programmatically when you want to change the visibility of your ImageView but that would be more work and probably unnecessary in this situation.

Categories : Android

How to create a view with a transparent view on it and background view touchable?
Something like this: UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Test Action Sheet" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Home",@"iPhone", nil]; [actionSheet showInView:self.navigationController.view];

Categories : Iphone

iOS Nested View Controllers view inside UIViewController's view?
No, this is generally good design, it helps keep your view controllers concise. However you should be using the view controller containment pattern, take a look at the following documentation. Implementing a Container View Controller This is incredibly simple to setup using Interface Builder with Storyboards as well, take a look at the Container View in the object library. Here is a contrived example in a Storyboard. In this example you would have 4 view controllers, one that holds the 3 containers, and one for each container. When you present the left most controller that has all of the containers, the Storyboard will automatically initialize and embed the other 3. You can access these child view controllers via the childViewControllers property or there is a method you can override pr

Categories : IOS

SplitViewcontroller programmatically hide master view
There are no ways to hide the master view programically as far as I know, but Matt Gammel has created a custom split view controller that allows lots of monuplation which has a costum built in method toggle the split view visible and hide it. Take a look at project and see if that helps you out. The appearance of the views are mimicking the split view controller so as far as appearance is concerned you should be fine. Anyway here is the direct link to the github project. https://github.com/mattgemmell/MGSplitViewController/

Categories : IOS

Change GRAVITY and SIZE of View programmatically
I have found the solution: canvasView = (CanvasView) findViewById(R.id.activity_dictionary_CanvasView); canvasView.canvasWidth = 100; canvasView.canvasHeight = 100; RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(canvasView.canvasWidth, canvasView.canvasHeight); //I want my Canvas be above LinearLayout and Horizontaly centered layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL); layoutParams.addRule(RelativeLayout.ABOVE, R.id.activity_dictionary_linearLayout2); canvasView.setLayoutParams(layoutParams);

Categories : Android

View disappears by setting the height programmatically
What are you trying to achieve, is the image always 1/3 of the screen width? If so, you could do this quite easily using layout weight in your layouts. Set weightSum=3 on the parent and then use a layout_weight=1 on the image view(s).

Categories : Android

how to change view to fragment programmatically (when internet not available)
Please provide some code. My tips: In main layout you should have FragmentLayout with id=main_fragment In activity create method "noInternetView()" which show on id=main_fragment a fragment with button "no internet" When is no internet run function noInternetView() other shows normal view Some code: //This code put into noInterneView() - because it opens fragment with no internet layout FragmentTransaction ft = getActivity().getFragmentManager().beginTransaction(); NoInternetFragment bdf = new NoInternetFragment(); ft.replace(R.id.main_fragment, bdf); ft.addToBackStack(null); ft.commit(); By changing Fragment use code above to open normal fragment And: If(noInternetConnection){ //open fragment with no internet laout - code above } else { //open fragment with normal layout }

Categories : Android

Adding a View inside a ScrollView programmatically
My guess is that you're using the wrong LayoutParams. The LayoutParams of a view should have the type of its parent. In your case: tv.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); Also, you are adding the TextView twice to your LinearLayout. ll.addView(tv); ll.addView(tv); Don't do this. Create a second TextView and add that if you need two TextViews in there. If these don't help, post your crash log from LogCat and I can help you from there.

Categories : Android

programmatically Overlay/add buttons on mjpeg view
It looks like you never add the buttons to your view, and you need to do something like mv.addView(keyBtn); for each of them. however adding the 3 buttons might not give you the layout you want, so what you could do is make an xml layout with all the buttons in it and add that to your view. Using something like this, or programatically XmlPullParser parser = res.getXml(R.layout.buttonsForVidUI); AttributeSet attributes = null; int state = 0; while(state != XmlPullParser.END_DOCUMENT) { try { state = parser.next(); } catch (XmlPullParserException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } if (state == XmlPullParser.START_TAG) { if (pars

Categories : Android

Margin set programmatically not applied instantly to the view
The width, height, margins, etc. of a View aren't applied inmediately, you need to wait for the UI to be sized and laid out on the screen. getWidth() returns 0 if set by android:layout_width="match_parent" Try this: ViewTreeObserver vto = color.getViewTreeObserver(); vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { this.layout.getViewTreeObserver().removeGlobalOnLayoutListener(this); Log.i("X", "" + color.getX()); } }); You will need to make "color" variable final or global to be able to access it inside the listener.

Categories : Android

Switch Active View Controller Programmatically
If you initialize a view controller programmatically you should use this init.

Categories : Objective C

Programmatically adding ABOVE to LayoutParams causes view height to be 0
where in your code are you checking for height? If it's somewhere within onCreate or onCreateView, you won't get any info. Layout is a two-pass process and in those two methods the two passes are not complete. You may need to get the height in those methods by using the ".post" method like this: myView.post( new Runnable() { @Override public void run() { int height = myView.getHeight(); } }); The runnable makes it run on the UI thread, but it's invoked after both passes, the measure pass and the layout pass, have completed. So trying to set a rule based on a center horizontal without first knowing the measurements is going to fail.

Categories : Android

MvvmCross: Programmatically adding a view to CollectionView's subview
In order for MvvmCross to create a View and to hook it up with it's ViewModel, MvvmCross uses a MvxViewModelRequest object. In iOS this is connected to the View using a Request property. You can hook this up yourself if you want to - it's just a get/set property that has to be set before ViewDidLoad occurs - see IMvxTouchView.cs Alternatively: if you want MvvmCross to create the View (including doing the ViewModel-View lookup) then there are some extension methods in https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Touch/Views/MvxCanCreateTouchViewExtensionMethods.cs if you don't need a viewController, then the MvxView class may be sufficient for you - see the N=32 video for an example of its use - http://slodge.blogspot.co.uk/2013/06/n32-truth-about-viewmodels-s

Categories : Iphone

UICollectionView with custom layout - how/where to add a supplementary view programmatically?
I think you have to follow this tutorial http://www.raywenderlich.com/22417/beginning-uicollectionview-in-ios-6-part-22

Categories : Iphone

Programmatically add content to static table view cell in IOS 6
How did you even create an IBOutlet for a single cell? The only thing you normally should be able to to if you want to personalize your cell in a xib is create a custom cell and use it programmatically in your cellForRow: atIndexPath:. However, I think the simplest solution here would be to do everything in code, as your app seems to be simple: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *identifier = @"Cell"; UITableViewCell *yourCell = [tableView dequeueReusableCellWithIdentifier:identifier]; if(!yourCell){ yourCell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } if(indexPath.row == yourDesiredCellInde

Categories : IOS



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