constraints

Constraints Removing SegmentController from view

℡╲_俬逩灬. 提交于 2020-01-07 08:35:43
问题 I have a UICollectionView and a SegmentController . The required end result: SegmentController fully in view, UICollectionView beneath it Before adding constraints: After adding constraints (Notice the SegmentController is almost entirely hidden): The Constraints added: ProductsCollection.removeConstraints(ProductsCollection.constraints) SegmentController.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ SegmentController.centerXAnchor.constraint(equalTo: view

move button towards target using constraints, no reaction?

无人久伴 提交于 2020-01-07 05:53:06
问题 I would like the red button to be animated towards the leading position of the second button : Some examples showed how to change the "constant" with numbers, but I would like to put automatically at the leading position of the second button. I tried this, but the red button does not move, the animations log is correctly called though : - (void)updateConstr{ NSLayoutConstraint *newLeading = [NSLayoutConstraint constraintWithItem:self.redB attribute:NSLayoutAttributeLeading relatedBy

SQL query to get primary keys for all tables in sybase ase 15.x along with column names

[亡魂溺海] 提交于 2020-01-06 23:43:07
问题 I'm using Sybase ASE 15.5 and a stranger to this database. Straight to the point--> I'm looking for a sql query that would help me get the primary keys for all tables in sybase along with the column names on which the primary key is declared. For example, if I have the following tables, organization having primary key PK_org_id on the column org_id org_alias having primary key PK_alias_id on the column alias_id org_temp having primary key PK_org_temp_id on the columns (org_id,org_name) then

Testing custom constraints in Grails App

风格不统一 提交于 2020-01-06 08:33:32
问题 I have the following as my unit test: void testCreateDealer() { mockForConstraintsTests(Dealer) def _dealer= new Dealer( dealerName:"ABC", Email:"abc-motors@global.com", HeadOffice:"", isBranch:false) assertFalse _dealer.validate() } But when I run the test I get the following error: No signature of method: static com.myCompany.Dealer.findByDealerNameIlike() is applicable for argument types: (java.lang.String) values: [ABC] I use some custom constraints in my domain class. How Can I test this

How to shrink UILabel spacing between lines without label being clipped?

为君一笑 提交于 2020-01-06 07:01:40
问题 I have a label which I am trying to shrink the spacing in between lines. I tried many things including changing the height multiple, min/max line spacing etc. When I changed the heigh multiple the label seemed to get clipped on top. I'm adding images to show as an example: This is a regular attributed label with default settings. Constraints: Leading 20, trailing 20, align center to Superview and Align Y to superview This is the same label but with the height Multiple set at 0.7 which

Can I constrain a route parameter to a certain type in ASP.net MVC?

不问归期 提交于 2020-01-06 06:54:49
问题 I have the following route: routes.MapRoute( "Search", // Route name "Search/{affiliateId}", // URL with parameters new { controller = "Syndication", action = "Search" } // Parameter defaults ); Is there a way I can ensure "affiliateId" is a valid Guid? I'm using MVCContrib elsewhere in my site and I'm fairly it provides a way to implement this kind of constraint.... I just don't know what it is! 回答1: You could write regex constraints: routes.MapRoute( "Search", // Route name "Search/

Can't change position of elements in webview

雨燕双飞 提交于 2020-01-06 04:47:06
问题 I developed a simple webview app which is working fine. Now I have to add a back button. I added it as a child of "FrameLayout". I can change the size, but I can't change the position of the button, it just sits at the top left... This seems to be the case for any element, I just tried it with ImageView and I have the same problems with it. I also tried to use "RelativeLayout" instead of "FrameLayout" as adviced in this answer, but it makes no difference Any help is appreciated. 回答1: I

How to fix strange behavior of date picker UIView when changing screen orientation in Objective-C?

半世苍凉 提交于 2020-01-06 04:30:09
问题 I have this project that requires to change the screen orientation of application once the user will pick a date using datePicker . Once the user tapped the Date button, It will show the datePicker The first image is the correct layout of the datePicker when portrait mode. Correct Portrait Layout When changing the screen orientation from Landscape to Portrait . It will appear the issue. Please refer to image below. The datePicker is located below Which is the image below should be the correct

SQL constraint to make 2 clumns not equal to each other

↘锁芯ラ 提交于 2020-01-06 03:47:31
问题 I have a table that has two columns to store id from another table. Column1 gets id from ABC table and Column2 also gets id from that table but letter is called parent ID, so with this information I know who is parent of who. Now I want to create a constraint not to ever let both columns to get same id. The following did not work: ALTER TABLE id_parent_table ADD CHECK (parent_id != main_id) This is still allowing to insert two identical numbers. 回答1: Apparently, MySQL does not support check

Add a column to a table with check constraint SQL

白昼怎懂夜的黑 提交于 2020-01-06 03:16:06
问题 I want to add a column to a table, then add a check constraint to make sure its greater than 0. I cant seem to get this to run in oracle sl developer. Alter TABLE store101 add column Base_salary Number(7,2) constraint store101_Base_salary_ck check (Base_salary > 0); Error report - SQL Error: ORA-00904: : invalid identifier 00904. 00000 - "%s: invalid identifier" 回答1: There is no ADD COLUMN clause in ALTER TABLE syntax. It's just ADD . ALTER TABLE store101 ADD Base_salary NUMBER(7, 2) -- there