Creating buttons on the fly and setting button properties
If I have a view and want to add buttons to it "on the fly" from values in an array, is that something straightforward to do?
I have an array of UIImageVIew objects and would like to create buttons from them (showing the image on the buttons) and associate those buttons with a method in my implementation file. That would be a lot more general and flexible than creating the buttons in the Interface Builder I would imagine.
And one more question - can I freely set button properties while doing that? Or in Objective-C can I only set properties that are already pre-defined for that class?
Thanks!
doug
Thanks for your reply.
That.... works! Thanks!
And I can generate the button and click on it and it calls my other method and that works too. Cool!
The syntax is still very mysterious to me, but I suppose eventually I'll understand what it all means.
Breaking it down to see what it means:
[button1 addTarget:self action:@selector(selectedHandler1:) forControlEvents:UIControlEventTouchUpInside];
* button1 is the object I created (I'm going to try to do this in a loop next.)
* addTarget is a message I am sending to button1 and the content of the message is "self", which refers to - this button? I'm not sure why such a message would be necessary.
* action is another message sent to button1 and the contents of that message are a little harder to parse. I see the result, and can mimic the syntax now that I've seen it, but I don't really understand what the @ is for, or the : after the method name or why this wouldn't just be "action: selectedHandler". I'm sure the language designers have a logical reason for all that, but I don't quite "grok" those extra symbols yet.
* forControlEvents is another message sent to button1 and the event message itself is clear in its meaning.
Anyway, that is working and I can refer more to the UIButton class reference now and try to set more stuff, like position it better, etc.
Thanks very much!
doug
Similar Messages
-
Hi,
In Sharepoint 2013 online without visual studio, I need to create a copy button in the ribbon and by selecting a listitem and clicking the copy button. A new form has to be displayed with
the selected listitem data. Please help me in doing this scenario.
Scenario:
Since Customer does not want to enter all the data once again. The customer will select a listitem and click the copy custom button in the ribbon, the data should be loaded in
a new form. The customer will do little modification and will click the submit button to save as a new list item. Please help me in doing this scenario
Thanks
LogeshHello Logesh,
You can use SharePoint designer workflow to achieve the above requirement.
See the below link for more details.
http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=223
My Blog- http://www.sharepoint-journey.com|
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful -
How to hide the Print and Export button in analytics report or tasks pane
Hi Experts,
In BIEE 11g,
How to hide the Print and Export button in analytics report or tasks pane ?
For example:
In console,I have created one userA which is belong to BIConsumer GROUP , when I make use of the highest user 'weblogic' to create one simple report, then the userA will login the analytivs to view this report (not dashboard), it will show the print and export as below.So customers do not want to give him the privilege for printing and exporting.
In addtion, go to catalog->tasks(left corner), it will also show the print and export button. So how to hide or not access these button?
Note: Maybe it can use the policy for consumer role for implementing this requirement, but I do not know how to modify the policy. Are you facing the problem? Thanks.Hi,
1. Create seperate folder for Reports & Dashobard.
2. For BI_Consumer (userA) set the catalog permission to view Dashboard Folder only and remove permission on the Report Folder (you can give traverse permission but don't give Open permision).
3. By this user won't be able to open or run any reports in that folder and the only way he can see the reports is through Dashboard and on dashboard the export and print buttone can be removed very easily.
Mark helpful if it helps.
Regards,
Kashi
Edited by: K N Yadav on 24 May, 2013 1:51 AM -
Problem activating the back and exit button with the ALV using OO
I have wrote my first alv using Methods.My problem is that i can't activete the BACK and EXIT button in the standart toolbar .
Look my code please .....
Without PF-STATUS can i do it ?
*& Report YDP_DOUBLE_ALV
REPORT YDP_DOUBLE_ALV.
TABLES : YQM_CERT , MARA , YOUTPUT_APPL.
DATA : ALV_GRID TYPE REF TO CL_GUI_ALV_GRID,
CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
FIELD_CAT TYPE LVC_T_FCAT,
LAYOUT TYPE LVC_S_LAYO.
DATA : ALV_GRID2 TYPE REF TO CL_GUI_ALV_GRID,
CUSTOM_CONTAINER2 TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
* FIELD_CAT TYPE LVC_T_FCAT,
* LAYOUT TYPE LVC_S_LAYO.
DATA: DYNNR TYPE SY-DYNNR,
REPID TYPE SY-REPID.
DATA: OK_CODE TYPE SY-UCOMM.
DATA : BEGIN OF ITAB OCCURS 0.
INCLUDE STRUCTURE YQM_CERT.
DATA END OF ITAB.
DATA : BEGIN OF ITAB1 OCCURS 0.
INCLUDE STRUCTURE YOUTPUT_APPL.
DATA END OF ITAB1.
* MODULE DISPLAY_ALV OUTPUT
MODULE DISPLAY_ALV OUTPUT.
SET PF-STATUS 'ZST9'.
PERFORM DISPLAY_ALV.
ENDMODULE. "DISPLAY_ALV OUTPUT
"DISPLAY_ALV OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
START-OF-SELECTION.
LAYOUT-ZEBRA = 'X'.
LAYOUT-GRID_TITLE = 'YQM_CERT'.
LAYOUT-CWIDTH_OPT = 'X'.
LAYOUT-SMALLTITLE = 'X'.
SELECT * FROM YQM_CERT INTO ITAB.
APPEND ITAB.
ENDSELECT.
SELECT * FROM YOUTPUT_APPL INTO ITAB1.
APPEND ITAB1.
ENDSELECT.
CALL SCREEN 100.
END-OF-SELECTION.
*& Form DISPLAY_ALV
* text
FORM DISPLAY_ALV.
IF ALV_GRID IS INITIAL.
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
* PARENT =
CONTAINER_NAME = 'CC_ALV'
* style =
* LIFETIME = lifetime_default
REPID = REPID
DYNNR = DYNNR
* NO_AUTODEF_PROGID_DYNNR =
* EXCEPTIONS
* CNTL_ERROR = 1
* CNTL_SYSTEM_ERROR = 2
* CREATE_ERROR = 3
* LIFETIME_ERROR = 4
* LIFETIME_DYNPRO_DYNPRO_LINK = 5
* others = 6
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT ALV_GRID
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
I_PARENT = CUSTOM_CONTAINER
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
* I_FCAT_COMPLETE = SPACE
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* others = 5
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'YQM_CERT'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
IS_LAYOUT = LAYOUT
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = ITAB[]
* IT_FIELDCATALOG =
* IT_SORT =
* IT_FILTER =
* EXCEPTIONS
* INVALID_PARAMETER_COMBINATION = 1
* PROGRAM_ERROR = 2
* TOO_MANY_LINES = 3
* others = 4
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
CALL METHOD ALV_GRID->REFRESH_TABLE_DISPLAY
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
* EXCEPTIONS
* FINISHED = 1
* others = 2
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. "DISPLAY_ALVHi
U need to active them in your status ZST9.
Max -
I am trying to setup my Time capsule via a ethernet cable as a back up for a new iMac. The on button on the time capsule set up window keeps failing to stay on. Any ideas what to do?
A PC can have more issues connecting than a Mac.
But it really should not matter.. so just try it in situ.. press and hold the reset.. once it starts up, it will return to default IP, 10.0.1.1 the PC should then be able to find it via the airport utility.
If not drag it over to the Mac and plug in there by ethernet.. or since it is a laptop, really should not be that difficult to drag the Laptop and plug it into the TC.
Important thing is to get access to the TC.
The Mac if it is running lion, then you MUST download and install 5.6 airport utility to do anything useful.
http://support.apple.com/kb/DL1482 -
How to delete help button in the wizard and dialogs.
Hello,
I am trying to delete the Help button in the wizard and dialogs provided by bibeans and having problems. Can someone give me an advise regarding the following three issues please? Thank you.
bibeans:bibeans903a
JDeveloper:JDeveloper903
1)Deleting the Help Button from the Print Dialog.
I'm using "oracle.dss.dataView.gui.PrintDialog" for the Print Dialog and this class has method to delete the Help button(setHelpEnabled(Boolean)).
But, the Help button is always displayed even when I set false for this method like below.
PrintDialog.setHelpEnabled(false);
2) Deleting the Help button from Open Dialog and BI Explorer.
I am using "PersistenceObjectChooser" class for Open Dialog and "Explorer" class for BI Explorer. But, these classes does not have a method to delete the Help button like the PringDialog class has. How can I delete the Help button for these dialogs?
3) Deleting the Help button from Calculation Builder.
I am using "CalcBuilderStepStorage" class to build a calculation and trying to delete the Help button like this.
((DefultBuilderDialog)calcBuilderStepStorage.getContainer()).getWizard().setHelpAvailable(false);
But, again the Help button will be displayedhi,
Use this code..
REPORT Z_TEST999 .
DATA itab TYPE TABLE OF sy-ucomm.
PARAMETERS test(10) TYPE c.
AT SELECTION-SCREEN OUTPUT.
APPEND: 'E' TO itab.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
TABLES
p_exclude = itab.
Regards,
Sailaja. -
I like to be able to navigate backwards and forwards without having to scroll down and find where I was previously. In Firefox Four, when using the forwards and back buttons, the page will automatically return to the top of the page. Is there any way to change this setting in Firefox Four to prevent it from doing that?
Thanks for the response. No Time Machine, but I probably have a backup from a few months ago on an external hard drive. :/ I guess it'd have useful history, but not if it overwrote the last 3 months or so of Awesome Bar, that might not be so great.
-
As i turned on my iphone 4s on and connected to a wireless internet a page opened from the app firewall ip and i usually choose all connections. so it got stuck i held the standy by button but it won't turn off. so i held the standyby and home buttons. when it opened all apps music and pics where not there. why? then i enterted photos and the loading logo appeared then the standyby appeared and i entered my password and everything in my iphone was there but thing were scattered and apps wheren't in folders everything was messed up but no photos or music AND IT SAYS UP IN THE MIDDLE OF THE SCREEN EXIT SAFE MODE. so i restarted it again and it opened and nothing was there and again i entered photos and the samething happen again. why did this happen? and can i get my data back? and in the usage it says that these thing are there but not showing.
stevejobsfan0123 wrote:
The Find my iPhone service option is given to you when you first set up the device. If you just reset it, you may have been given that option. So, in other words, the service may have been enabled even if you didn't realize it. You can then go to www.icloud.com and click on Find my iPhone, and have it play a sound. Or, you can use the Find my iPhone app on your mom's iPhone, but the service would still need to be turned on on your iPod.
Unlike Compukid said, Apple will not assist in locating a lost device without the Find my iPhone service.
I found that out 2 years ago, it's just that I thought Apple might have changed that. -
In 3.6.16, the buttons are all over the place. In previous versions, the forward, back, refresh, stop and home buttons were all together. In this version, the refresh and stop buttons are between the address and search windows, and the home button to the far right.
I would love to have them all together as they used to be - much more user friendly that way. I have tried installing alternate themes, but the coding of this version over-rides the themes.Firefox 4.0 has a combined Reload and Stop and Go button that appears at the right end of the location bar.
To restore the Firefox 3 appearance you can use these steps:
* Open the "View > Toolbars > Customize" window to move the Stop and Reload button out of the location bar.
* Move the Reload and Stop buttons to their previous position at the left side of the location bar.
* Set the order to "Reload - Stop" to get a combined "Reload/Stop" button.
* Set the order to "Stop - Reload" or separate them otherwise to get two distinct buttons. -
How to remap keyboard - Looking to switch the "fn" and "control" buttons?
Hi I was looking for a way to switch the function and control on the bottom left side of the keyboard on my macbook pro laptop. I am used to the control button being the button that is furthest to the left and its just really throwing me off having the fn key all the way to the left. If anyone knows how to remap these keys, I would really appreciate the help.
Thank you.Firefox 4.0 has a combined Reload and Stop and Go button that appears at the right end of the location bar.
To restore the Firefox 3 appearance you can use these steps:
* Open the "View > Toolbars > Customize" window to move the Stop and Reload button out of the location bar.
* Move the Reload and Stop buttons to their previous position at the left side of the location bar.
* Set the order to "Reload - Stop" to get a combined "Reload/Stop" button.
* Set the order to "Stop - Reload" or separate them otherwise to get two distinct buttons. -
struggling to wake my apple tv wont respond even when holding the menu and down button any ideas ?
Did you try unplugging the unit from power, leaving it for ten minutes, then plugging in again?
If you have & it didn't work, Damian Smith1 posted this possible solution (I like to give credit where credit is due).
Connect your ATV to your computer and try restoring it to factory setting Use the link below to walk you through the process
Apple TV (2nd generation): Restoring your Apple TV
support.apple.com/kb/HT4367 -
Hello,
I must have changed a setting, so that the "Delete" and "Junk" buttons above the mail pane have disappeared, and an "Archive" button has appeared instead. This is true only for my mail through Gmail (IMAP), but when i open a mail from my other account (POP), i still see the "Delete" and "Junk" buttons.
How can I fix this?
Thanks in advance
AyseTry this:
Select an email that does not show all the correct buttons in the header information section above the actual message.
right click on the blank area just above 'Other Actions', you should get a popup saying 'Customise'.
click on 'Customise'
a new window opens.
you can drag items onto that header area, but I would suggest you click on 'Restore Default Set' button and then clickon 'Done' button. -
Got a black screen on the iPod Touch 4th Generation. Tried restoring it and holding the lock and hold buttons but this didnt work. Do i need a brand new screen?
If you successfully restored to factory settings/new iPod via iTunes (Not via Settings>General>Reset>Erase all Content and Setting) and still have the problem that indicates a hardware problem. Could be the screen or something else.
Make an appointment at the Genius Bar of an Apple store..
Apple Retail Store - Genius Bar -
The "refresh" button and the button for my homepage appeared on the line just under the Menu Bar. Also, the MSN icon appeared on the fourth line under the Menu Bar. All three are now missing How do I get them back, or do I have to uninstall FF4. Why does an upgrade have to change toolbars without giving me notice?
You can find the Home button at the far right end of the Navigation Toolbar.
Firefox 4 uses a combined Stop/Reload/Go button that is positioned at the right end of the location bar.<br />
During the page load process it shows as a Stop button and after the loading has finished the button is changed to a Reload button.<br />
If you type in the location bar then that button becomes a Go button.<br />
You can middle-click that Reload button to duplicate the current tab to a new tab.
To move the Stop and Reload buttons to their position to the left of the location bar you can use these steps:
* Open the "View > Toolbars > Customize" window to move the Stop and Reload button out of the location bar.
* Drag the Reload and Stop buttons to their previous position to the left of the location bar.
* Set the order to "Reload - Stop" to get a combined "Reload/Stop" button.
* Set the order to "Stop - Reload" or separate them otherwise to get two distinct buttons. -
If you hold down the up and down buttons....
hi. Am i being really stupid but if you hold the up or down buttons on a macbook pro keyboard it doesnt scroll up and down the page? if you keep pressing the buttons it does or press the fn button together with the up or down arrows it works as it does with the touch pad mouse.
Just thought that like an a pc laptop the up and down buttons would scroll up and down a page by holding them down which my macbook pro doesn"t.
Am i right or do i have a faulty keyboard?
Thanks
Robi have figured out the answer. In system preferences the keboard options were set as long/slow. now i have adjusted them to very fast and my kepboard is responsive again. cant believe i was so dumb!
thanks for your replies
rob
Maybe you are looking for
-
I removed Bing from my computer as I did not like it much. Since Google has now become such a useless piece of junk I decided to re-install Bing but each time I try I get the following message. Quiote: Firefox could not install the search plugin from
-
How do I print just this page?
In the print options, I can go to the pages section and designate the page number to print, but that requires several steps. In Word I would hit Control-P then Alt-E and the current page would print. Is there a similar option in Pages? Is it possible
-
I have one issue SELECT CPID and PERNR for all SELECTED PA0002 RECORDS FROM zcustom THEN MATCH zcustom.CPID TO SAP 6.0 HRP1000.CPID lookup new PERNR from HRP1000 and move new PERNR to this field. but in this i have problem in HRP1000 which is ref
-
How Much Ram can I put in a MBP C2D 2.4 15" (08) (MB133LL/A)
Can I put 2x4gb modules? 8gb? Link?
-
Pop-up Menu is aligned with the top of the window in IE7
Using Fireworks MX I created a pop-up menu on an image I would like to put within a table not in the top of the window. If I view the page with Firefox, the menu is aligned with the image, but if I use IE7 the pop-up menu is aligned with the top of t