superkb10's Profile User Rating: -----

Reputation: 29 Craftsman
Group:
Active Members
Active Posts:
298 (0.29 per day)
Joined:
27-November 11
Profile Views:
2,623
Last Active:
User is offline Sep 06 2014 01:35 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Who Cares
Favorite Gaming Platform:
XBox
Your Car:
Who Cares
Dream Kudos:
0
Icon   superkb10 has not set their status

Posts I've Made

  1. In Topic: Society's reason for programming

    Posted 21 Sep 2013

    I'm not saying money isn't a factor, I understand the importance of money, in fact, I would say that I care about money more than most my age at least. However, I don't think that the only reason given for learning programming should be that it will make you money. I mean, if a football player said "I only do this for the money", he'd be lynched, but for some reason the only reason people think you should program is because there will be jobs. I'm not opposed to programming for money, I just don't like how they only talk about it being useful for finding somebody to be your boss.
  2. In Topic: Confusion with Calling Methods in Objective C

    Posted 30 Jul 2013

    So, in your first line of code, what you are doing in the first line, is creating a pointer to a string, but the value of that pointer is null, basically all it does is tell the compiler, "This is a variable I might have a value for later". If you were to try to use the pointer without the second line, it would return an error because that pointer doesn't have a value. You could combine the first and second lines of your code and just do this:

    NSString *myString = [[NSString alloc] init];
    
    


    The above code would do the same thing, the only times where you wouldn't want to do it in one line, is if A. It's a class variable and you want to set a value in the constructor. Or B. You have different values you are going to set based on how something else happened in the code. There might be more times you wouldn't want to do that, by I can't think of any off the top of my head. The alloc function is a function of NSObject, which is the super class of NSString, what alloc does is it allocates a piece of the system memory for storing this data value, and it returns the pointer to that location in memory where it has allocated space. The init function is what essentially fills this piece of memory with data for a string, for other classes, you might be setting the values of the different properties of the class, or whatever, if you've ever done any other programming languages, it really just runs the custom constructor for that class.
  3. In Topic: Text running off page. How to end wtih ...

    Posted 30 Jul 2013

    Is there a reason you're not just putting three dots at the end of the char array where you see it would run off the screen? If it's because the text's position changes, I would recommend using Label.frame.origin.y to get the position of the top of the text, then, just find how high your text is (it's usually the font size), calculate how many lines should be shown, check in your char array through testing where the locations are for a new line, and just replace the end of that with a "...". If you're intending for the user to scroll the text, usually you wouldn't put a "..." at the end, because as long as the text ends a bit abruptly, most users will know to scroll down.
  4. In Topic: "Carry" a View between Layouts

    Posted 6 Jul 2013

    Okay, so I think I've figured out a solution to this, but it doesn't quite work yet, basically, what I did, was I used LayoutInflater to get the different layouts, I have a RelativeLayout, where everything runs, I have the AdView at the bottom, then I have a View as a place holder above the AdView, then, I just remove the view at index 0, and add on my new Layout at index 0. I've run the debugger, and it says the Layout should be there, and that it is the layout I expected, however, when I test it on my phone, it shows like there is nothing there. Here's the code

    Loads the Layouts in my MainActivity

    		MainLayout = (RelativeLayout) findViewById(R.id.MainLayout);
    		LayoutInflater inflater = getLayoutInflater();
    		MainMenuLayout = (LinearLayout) inflater.inflate(R.layout.mainmenu_layout, null).findViewById(R.id.MainMenuLayout);
    
    


    In another class, shows the layout:

    		MainActivity.MainLayout.removeViewAt(0);
    		MainActivity.CurrentOpen = MainActivity.MAINMENU;
    		RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
    				RelativeLayout.LayoutParams.WRAP_CONTENT);
    		params.addRule(RelativeLayout.ALIGN_TOP, RelativeLayout.TRUE);
    		MainActivity.adView.setVisibility(View.VISIBLE);
    		MainActivity.MainLayout.addView(MainActivity.MainMenuLayout, 0, params);
    
    


    My MainMenu Layout:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="50dp"
        android:orientation="vertical" 
        android:id = "@+id/MainMenuLayout"
        android:background = "#000000">
    
    <!-- Views that I have  -->
    
    </LinearLayout>
    
    


    I know there's something simple I must be doing wrong, I'm just not sure what it could be. Any ideas?

    Edit: Figured it out, just needed to change my LayoutParams from WRAP_CONTENT to MATCH_PARENT and it worked fine. Thanks for suffering through 7 posts guys.
  5. In Topic: "Carry" a View between Layouts

    Posted 5 Jul 2013

    Okay, so I tried instead of creating a new class, just overriding the onCreate() method by doing

     
    	public Fragment MainMenuFragment = new Fragment()
    	{
    		@Override 
    		public View onCreateView(LayoutInflater inflater, ViewGroup container, 
    		        Bundle savedInstanceState)
    		{
    			return inflater.inflate(R.layout.mainmenu_layout, container, false);
    		}
    	};
    
    


    However, the issue right now is that I am using a minimum API level of 7, while Fragments require a minimum API level of 11. Any ideas?

My Information

Member Title:
D.I.C Regular
Age:
16 years old
Birthday:
January 1, 1998
Gender:
Years Programming:
.5
Programming Languages:
C#

Contact Information

E-mail:
Private

Friends

superkb10 hasn't added any friends yet.

Comments

Page 1 of 1
  1. Photo

    mickyy Icon

    17 Aug 2012 - 20:50
    hello
  2. Photo

    superkb10 Icon

    18 Apr 2012 - 14:21
    Actually, 13, I just never bother to change the month or date ^_^
  3. Photo

    DimitriV Icon

    12 Apr 2012 - 19:19
    I think you're 14, dude!
Page 1 of 1