Adding a View to a child of a custom View
I have created a custom view called SlideUpDownLayout that extends
RelativeLayout. It contains an ImageButton and a HorizontalScrollView.
Inside HorizontalScrollView there is a LinearLayout. I would like whatever
View I add via xml to the SlideUpDownLayout to be added automatically to
the LinearLayout. I tried by overriding onFinishInflate() but it seems
that when I use this the ImageButton does not respond.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@android:color/transparent"
tools:context=".SlideUpActivity"
android:id="@+id/slideLayout">
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="@null"
android:src="@drawable/arrow_down" />
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:layout_alignParentBottom="true"
android:layout_below="@+id/imageButton1" >
<LinearLayout
android:id="@+id/magic_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<!-- I would like the views to get inside here -->
</LinearLayout>
</HorizontalScrollView>
</RelativeLayout>
<!--for example -->
<com.example.downbar.SlideUpDownLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/checkBox2" >
<!-- these ImageViews here to be added in the LinearLayout
magic_layout-->
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/exp_icon" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</com.example.downbar.SlideUpDownLayout>
Tuesday, 3 September 2013
Monday, 2 September 2013
how to get button title using for loop
how to get button title using for loop
//here take a array with letters
_englishArray = [[NSMutableArray
alloc]initWithObjects:@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z",
nil];
int i=0;
float x=5,y=13;
//add array elements as button title
for (i=0; i< [_englishArray count]; i++) {
button.tag=i+1;
button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self action:@selector(myAction:)
forControlEvents:UIControlEventTouchUpInside];
[button setTitle:[_englishArray2 objectAtIndex:i]
forState:UIControlStateNormal];
button.frame= CGRectMake(x, y, 29, 30);
button.titleLabel.textColor =[UIColor whiteColor];
x= x+31;
if (x==320 || x>310) {
x=5;
y=y+40;
}
[_keyboardImageView addSubview:button];
}
//here get the button title useing for loop
// and i add the each button to _keyboardImageView and set title as
_english arry elements ...and the get buttons curren title for this
code....
for (int j=0;j<=[_englishArray count]; j++) {
butt = (UIButton *)[_keyboardImageView viewWithTag:j+1];
NSLog(@"%@",butt.titleLabel.text);
}
//it prints null not give button title............ // Note:i am useing
butt.currentitle also how it is possible
//here take a array with letters
_englishArray = [[NSMutableArray
alloc]initWithObjects:@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z",
nil];
int i=0;
float x=5,y=13;
//add array elements as button title
for (i=0; i< [_englishArray count]; i++) {
button.tag=i+1;
button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self action:@selector(myAction:)
forControlEvents:UIControlEventTouchUpInside];
[button setTitle:[_englishArray2 objectAtIndex:i]
forState:UIControlStateNormal];
button.frame= CGRectMake(x, y, 29, 30);
button.titleLabel.textColor =[UIColor whiteColor];
x= x+31;
if (x==320 || x>310) {
x=5;
y=y+40;
}
[_keyboardImageView addSubview:button];
}
//here get the button title useing for loop
// and i add the each button to _keyboardImageView and set title as
_english arry elements ...and the get buttons curren title for this
code....
for (int j=0;j<=[_englishArray count]; j++) {
butt = (UIButton *)[_keyboardImageView viewWithTag:j+1];
NSLog(@"%@",butt.titleLabel.text);
}
//it prints null not give button title............ // Note:i am useing
butt.currentitle also how it is possible
SQL - How Do I Search a Sentence and Match by Keywords Separated by a Semicolons (a search like Google)
SQL - How Do I Search a Sentence and Match by Keywords Separated by a
Semicolons (a search like Google)
I currently have knowledge base articles in a database and the system
seperates the keywords relating to the article by a semicolon.
On the front facing form i have a text box limited to 100 characters. How
do i create a SQL query that looks at the words within the text box and
starts matching those words to the keywords within the database?
I basically want to create a search alittle like google one.
I am currently using like '%{token}%'. However this is not good enough.
Thank you.
Kindest Regards Wayne
Semicolons (a search like Google)
I currently have knowledge base articles in a database and the system
seperates the keywords relating to the article by a semicolon.
On the front facing form i have a text box limited to 100 characters. How
do i create a SQL query that looks at the words within the text box and
starts matching those words to the keywords within the database?
I basically want to create a search alittle like google one.
I am currently using like '%{token}%'. However this is not good enough.
Thank you.
Kindest Regards Wayne
Aestan Tray Menu Error while installing WAMP
Aestan Tray Menu Error while installing WAMP
Installed latest vesrion of WAMP Server(32 bits and php 5.4)2.4.. then
installed VC10 SP1 vcredist_x86.exe 32 bits. still when i click on WAMP
icon..it says "Aestan Tray Menu has encountered a problem and needs to
close. We are sorry for the inconvenience"
Installed latest vesrion of WAMP Server(32 bits and php 5.4)2.4.. then
installed VC10 SP1 vcredist_x86.exe 32 bits. still when i click on WAMP
icon..it says "Aestan Tray Menu has encountered a problem and needs to
close. We are sorry for the inconvenience"
Link records in two tables without extra SubmitChanges
Link records in two tables without extra SubmitChanges
Given two tables, where one is bound to another:
Items
SubItems
The Items table has an ID field with Identity Seed.
Here's the problem: to add SubItems to an Item, it's necessary to first
save the Item, so the ID is generated. An extra call to
DataContext.SubmitChanges is required before SubItems can be added and
submitted.
Is there any way to set up the identity to allow just a single
SubmitChanges call to save both the Item and SubItems at once?
One solution could be getting the IdentitySeed manually - but here is an
issue with multithreading.
Given two tables, where one is bound to another:
Items
SubItems
The Items table has an ID field with Identity Seed.
Here's the problem: to add SubItems to an Item, it's necessary to first
save the Item, so the ID is generated. An extra call to
DataContext.SubmitChanges is required before SubItems can be added and
submitted.
Is there any way to set up the identity to allow just a single
SubmitChanges call to save both the Item and SubItems at once?
One solution could be getting the IdentitySeed manually - but here is an
issue with multithreading.
using `?:` in the output stream
using `?:` in the output stream
I want to integrate the ?: operator in the output stream. Here is code
bool a;
for (int i = 0; i < 10; i++ ) {
a = rand() % 2;
std::cout << "a= " << (a) ? "true\n" : "false\n";
}
But the output is
a= 1a= 0a= 1a= 1a= 1a= 1a= 0a= 0a= 1a= 1
The problem is, there are no new line and string. What should I do?
I want to integrate the ?: operator in the output stream. Here is code
bool a;
for (int i = 0; i < 10; i++ ) {
a = rand() % 2;
std::cout << "a= " << (a) ? "true\n" : "false\n";
}
But the output is
a= 1a= 0a= 1a= 1a= 1a= 1a= 0a= 0a= 1a= 1
The problem is, there are no new line and string. What should I do?
Sunday, 1 September 2013
How to capture sqlplus command line output in unix file
How to capture sqlplus command line output in unix file
I am running below : sqlplus
ABC_TT/asfddd@\"SADSS.it.uk.hibm.sdkm:1521/UGJG.UK.HIBM.SDKM\" afte that I
am executing one stored procedure exec HOLD.TRWER I want to capture return
code of the above stored procedure in unix file as I am running the above
commands in unix. Please suggest.
I am running below : sqlplus
ABC_TT/asfddd@\"SADSS.it.uk.hibm.sdkm:1521/UGJG.UK.HIBM.SDKM\" afte that I
am executing one stored procedure exec HOLD.TRWER I want to capture return
code of the above stored procedure in unix file as I am running the above
commands in unix. Please suggest.
Subscribe to:
Posts (Atom)