Search Results

Search found 641 results on 26 pages for 'imageview'.

Page 15/26 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Iphone page curl effect

    - by dragon
    I am using this code for Page curl effect ....Its work fine in simulator and device... But its not (setType:@"pageCurl") apple documented api , this caused it to be rejected by the iPhone Developer Program during the App Store review process: animation = [CATransition animation]; [animation setDelegate:self]; [animation setDuration:1.0f]; animation.startProgress = 0.5; animation.endProgress = 1; [animation setTimingFunction:UIViewAnimationCurveEaseInOut]; [animation setType:@"pageCurl"]; [animation setSubtype:@"fromRight"]; [animation setRemovedOnCompletion:NO]; [animation setFillMode: @"extended"]; [animation setRemovedOnCompletion: NO]; [[imageView layer] addAnimation:animation forKey:@"pageFlipAnimation"]; So i changed and using like this [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1]; [UIView setAnimationDelegate:self]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; [UIView setAnimationWillStartSelector:@selector(transitionWillStart:finished:context:)]; [UIView setAnimationDidStopSelector:@selector(transitionDidStop:finished:context:)]; // other animation properties [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:imageView cache:YES]; // set view properties [UIView commitAnimations]; In this above code i want to stop the page curl effect at midway.. But i cant stop it in midway like map applications in ipod... Is this any fix for this? or Is there any apple documented methods used for page curl effect in ipod touch? I am searching lot. but didnt get any answer ? can anyone help me? Thanks in advance..plz

    Read the article

  • OutofMemoryError: bitmap size exceeds VM budget (Android)

    - by Chrispix
    Getting an Exception in the BitmapFactory. Not sure what is the issue. (Well I can guess the issue, but not sure why its happening) ERROR/AndroidRuntime(7906): java.lang.OutOfMemoryError: bitmap size exceeds VM budget ERROR/AndroidRuntime(7906): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:295) My code is pretty straight forward. I defined an XML layout w/ a default image. I try to load a bm on the SDCard (if present - it is). If not it shows the default image. Anyway.. Here is code : public class showpicture extends Activity { public void onCreate(Bundle savedInstanceState) { /** Remove menu/status bar **/ requestWindowFeature(Window.FEATURE_NO_TITLE); final Window win = getWindow(); win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); Bitmap bm; super.onCreate(savedInstanceState); setContentView(R.layout.showpicture); try { ImageView mImageButton = (ImageView)findViewById(R.id.displayPicture); bm = Bitmap.createScaledBitmap(BitmapFactory.decodeFile("/sdcard/dcim/Camera/20091018203339743.jpg"),100, 100, true); parkImageButton.setImageBitmap(bm); } catch (IllegalArgumentException ex) { Log.d("MYAPP",ex.getMessage()); } catch (IllegalStateException ex) { It fails on the bm=Bitmap.createScaledBitmap any thoughts? I did some research on the forums, and it pointed to this post I just don't know why it is not working. Any help would be great! Thanks, Chris.

    Read the article

  • how to send image to remote server using webservices in android only save to byte array retrieve ima

    - by narasimha
    hi sir i am implemented this code public class ImageTest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView image = (ImageView) findViewById(R.id.picview); EditText value=(EditText)findViewById(R.id.EditText01); FileInputStream in; BufferedInputStream buf; try { in = new FileInputStream("/sdcard/pictures/1.jpg"); buf = new BufferedInputStream(in,1070); System.out.println("1.................."+buf); byte[] bMapArray= new byte[buf.available()]; buf.read(bMapArray); System.out.println("2................."+buf.read(bMapArray)); Bitmap bMap = BitmapFactory.decodeByteArray(bMapArray, 0, bMapArray.length); for (int i = 0; i < bMapArray.length; i++) { System.out.print(bMapArray[i]); } System.out.println("3......................"+bMap); System.out.println("4........bitmaparray"+bMap.extractAlpha()); System.out.println("5......................"+bMapArray); System.out.println("6......................"+ bMapArray.length); image.setImageBitmap(bMap); value.setText(bMapArray.length); if (in != null) { in.close(); } if (buf != null) { buf.close(); } } catch (Exception e) { Log.e("Error reading file", e.toString()); } } } 04-14 11:46:16.543: INFO/System.out(736): 2.................-1 3......................android.graphics.Bitmap@435a2d98 4........bitmaparrayandroid.graphics.Bitmap@435a3310 5......................[B@435a2758 6......................1035

    Read the article

  • Android: failed to setContentView when switching to ListActivity

    - by Yang
    This is an follow-up issue on my previous question http://stackoverflow.com/questions/2548304/android-which-view-should-i-use-for-showing-text-and-image I read the article about creating ListView for LinearLayout. However, my following code failed at the setContentView() function when I changed "extends Activity" to "extends ListActivity", any idea why? private TextView mSelection; //private ImageView mImages; static final String[] keywords = new String[]{"China", "Japan", "USA", "Canada"}; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.contactLayout); mSelection = (TextView)findViewById(R.id.ContactNames); ArrayAdapter adapter = new ArrayAdapter<String>(this, R.layout.contactlayout, R.id.ContactNames,keywords); setListAdapter(adapter); } My Layout is from this article: http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="?android:attr/listPreferredItemHeight" android:padding="6dip"> <ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="6dip" android:src="@drawable/icon" /> <LinearLayout android:orientation="vertical" android:layout_width="0dip" android:layout_weight="1" android:layout_height="fill_parent"> <TextView android:id="@+id/ContactNames" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center_vertical" android:text="My Application" /> <TextView android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:singleLine="true" android:ellipsize="marquee" android:text="Simple application that shows how to use RelativeLayout" /> </LinearLayout>

    Read the article

  • iPhone: how do i redraw subviews while pinch zooming a uiscrollview

    - by Mike
    I am developing an iPhone app that places multiple custom UIViews as subviews in a UIScrollView. The subviews are placed on top of each other as transparent views as each view has its own drawing routines that traces parts of the base view. The base view is a UIImageView that is typically a large image that I want the user to be able to pan and zoom in and out of. The problem I am having is that when I zoom in and out of my UIScrollView, the subviews do not redraw themselves while the user is zooming. I can reposition and scale the subviews properly once the zoom is completed, but the user experience is less than desirable. I have not been able to find a way to either hide or redraw the subviews as the zoom is taking place to scale the subviews along with the ImageView. Any ideas? thanks! Here is the code that I have implemented: - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale { for (UIView *view in subViews) { [view updateView:scale]; } } - (UIView *)viewForZoomingInScrollView:(UIScrollView *) scrollView { return imageView; }

    Read the article

  • IKImageView resize is blocky

    - by Brian Postow
    I am putting an image into an IKImageView, and immediately sizing it to fit. Whenever I do this, the image originally appears at 1-1 size (huge) and then resizes down, which would be fine if the animation was smooth. However, the animation looks ... fluttery? There are big blocks, like 2 inches square, of the image that appear and shrink independently of each other. The effect is a little annoying, and almost to the level where it might give an epileptic a seizure... (I'm exaggerating a little). Is this a bug in IKImageView? Is it a bug in the animation? Will it go away if I turn off the animation (How do I do that? setAnimates: NO doesn't seem to do anything, nor does overloading animates to return NO in my subclass... EDIT: addedcode: NSImage* image = [doc currentImage]; [imageView setImage: image]; [imageView zoomImageToFit: self]; This is in the app controller, so self is the application (or plugin, depending on which version I'm looking at)

    Read the article

  • Android's RelativeLayout Unit Test setup

    - by dqminh
    i'm trying to write an unit test for my Android's RelativeLayout. Currently, my testcode setup is as follow: public class SampleRelativeLayoutTest extends AndroidTestCase { private ViewGroup testView; private ImageView icon; private TextView title; @Override protected void setUp() throws Exception { super.setUp(); // inflate the layout final Context context = getContext(); final LayoutInflater inflater = LayoutInflater.from(context); testView = (ViewGroup) inflater.inflate(R.layout.sample_layout, null); // manually measure and layout testView.measure(500, 500); testView.layout(0, 0, 500, 500); // init variables icon = (ImageView) testView.findViewById(R.id.icon); title = (TextView) testView.findViewById(R.id.title); } However, I encountered NullPointerException with the following stack trace java.lang.NullPointerException at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:427) at android.view.View.measure(View.java:7964) at com.dqminh.test.view.SampleRelativeLayoutTest.setUp(SampleRelativeLayoutTest.java:33) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447) What should I change in my setUp() code to make the test run properly ?

    Read the article

  • UIButton overlapping problem in the UIView?

    - by sai
    im trying to create buttons as ahierarchy, first some buttons are displayed if i click any of the buttons it will navigate to the next viewcontroller displaying some more buttons. But here my problem is butons are overlapped with one another . means the buttons that should not be displayed are also comming along with those should be . my code is for(.................) { butt = [[UIButton alloc] initWithFrame:CGRectMake(...)]; image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[arr objectAtIndex:i]]]]; imageView = [[[UIImageView alloc] initWithImage:image] autorelease]; [butt setBackgroundImage:imageView.image forState:UIControlStateNormal]; [butt setTag:i]; [butt addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside]; [containerView addSubview:butt]; [butt release]; x+=butt.frame.size.width+2*hgap; i+=1; if (i==count+1) //[arr count] { printf("\nIN BREAK BUTTON\n"); break; } } y=y+(butt.frame.size.height+2*vgap); } Thankyou for the solution.

    Read the article

  • Looking for an elegant appwidget skin solution

    - by sam-henwood
    I have an appwidget application and would like to enable users to create skins which can be applied at runtime. My preferred solution is to use apk files with nine patch png images that stretch to fit the ImageView's of widget, however its starting to look like I might have to use another packaging technique (e.g. zip files). What I've tried: Importing nine patch resources as Drawable with context.getResourcesForApplication(my.app).getResources..., converting them to bitmaps using a canvas and setting the bitmap to the RemoteView using setImageViewBitap. This didn't work because I needed to specify the size of the resulting view (myBitmap.setBounds(..,..)) during conversion and some of the widths/heights in my appwidget aren't fixed. Perhaps there is a way to get the heights etc that I missed. Importing resources directly to the RemoteView using setImageViewUri() This doesn't work because the function doesn't seem to read android.resource:// Uri's anymore (I poked around in the ImageView source and it only seems to read files paths and content:// Uri's) Importing resources directly to the RemoteView using setImageViewResource() which didn't work because the id retrieved from the external package obviously doesn't include a package reference. What I'm trying to avoid is hard coding all my appwidget width's and height's, or using a separate packaging scheme. Has anyone implemented appwidget skins nicely and want to share the knowledge? Alternately there might be a hole in my logic somewhere that can be pointed out. I can provide code if required though I don't have any here right now.

    Read the article

  • Image "moves" when varying heightForRowAtIndexPath in UITableViewCell.

    - by Kalle
    I have a table view with varying height, as defined in the heightForRowAtIndexPath. For some very odd reason, the image is "indented" to the right based on the height; if the height is low enough, the image is stuck to the left side of the cell, but as the height increases, the image for said cell is shifted rightward compared to other rows. The result of this is a very poor looking list, with images floppily laid out in a zig-zag pattern depending on the height of each individual row. The problem is revealed by this simple example: - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return (indexPath.row+1) * 50; } Each cell is set up (simplified) as a "Subtitle" style cell with: // ... cell.textLabel.text = @"foo"; cell.detailTextLabel.text = @"bar"; cell.imageView.backgroundColor = [UIColor redColor]; // for debugging; i have images with transparent bg cell.imageView.image = anImageThatIs55x50pixelsBig; return cell; Any ideas? My head bleeds from the wall-love-affair. Edit: uploaded a screen which displays this. The "image" is just a screenshot of a tiny area of the screen which makes it look a little weird, but you get the picture I'm sure: http://img28.imageshack.us/img28/549/screenshot20100311at172.png

    Read the article

  • Adding an observer to UIImageView? observer & notifications

    - by sagar
    Each class has almost one method named addObserver [imgVURL addObserver:<#(NSObject *)observer#> forKeyPath:<#(NSString *)keyPath#> options:<#(NSKeyValueObservingOptions)options#> context:<#(void *)context#>] Here, imgVURL is an image which is going to be load an image asynchronously. When image will be loaded dynamically - other class will set an image from loaded data. Now, my question is how can we add an observer to UIImageView's instance. Observer and notifications are same or not ? If it is not then what's different ? Let's have some sample code That I did in my project to understand my question. // locating image view from Scroll view by it's tag imgVURL=(UIImageView*)[scrMain viewWithTag:(kTagImagesTag+i)]; // ImageViewURL is a class which contains methods of // didReceiveResponse // didReceiveData // connection ImageViewURL *tmp=[[ImageViewURL alloc] init]; // it has a nonatomic property which will take the reference of my image view tmp.imgV=imgVURL; // now I will pass a url from my an array to property strURL // in strUrl I have custom setter // in which I am initializing a connection tmp.strUrl=[NSURL URLWithString:[[tblmain objectAtIndex:i] valueForKey:@"url"]]; // from ImageViewURL.m file -(void)connectionDidFinishLoading:(NSURLConnection *)connection { [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; // NSLog@"ImageView Ref From - %@",imgV); // see imgV has reference of my -> imgVURL (nonatomic,assign) imgV.image=[UIImage imageWithData:myWebData]; [connection release]; connection=nil; } // as you can see in above code many many images are loaded asynchronously // now How can I add an observer to an imageview whether it received or not.

    Read the article

  • screens goes up when soft keyboard came in front in And

    - by Sanat Pandey
    I have a question that, I want to take our Activity screen up when a softskeyboard came, in my app on Android Phone. I have used android:windowSoftInputMode="adjustResize|adjustPan" property in Android Manifest but nothing changed, problem remains same. Please suggest me for the right solution. Thanks in advance. XML: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff"> <FrameLayout android:id="@+id/frame" android:layout_gravity="top|bottom|center_horizontal" android:layout_width="wrap_content" android:layout_marginTop="10dip" android:layout_height="wrap_content"> <ImageView android:layout_gravity="center_horizontal" android:id="@+id/imageView1" android:src="@drawable/logo" android:layout_width="wrap_content" android:layout_marginTop="10dip" android:layout_height="78dp"></ImageView> </FrameLayout> <FrameLayout android:id="@+id/frameLayout1" android:layout_width="wrap_content" android:background="@drawable/login_box_bg" android:layout_gravity="center_horizontal" android:layout_marginTop="180dip" android:layout_height="wrap_content"> <EditText android:inputType="textEmailAddress" android:id="@+id/ed_Login_Email" android:background="@drawable/login_input_bg" android:layout_gravity="center_horizontal" android:layout_marginTop="10dip" android:layout_width="290dip" android:layout_height="40dip" android:hint="Email:" android:paddingLeft="10dp"> </EditText> <EditText android:background="@drawable/login_input_bg" android:layout_width="290dip" android:layout_gravity="center_horizontal" android:id="@+id/ed_Login_Pwd" android:inputType="textPassword" android:layout_marginTop="70dip" android:layout_height="40dip" android:hint="Password:" android:paddingLeft="10dip"> </EditText> <Button android:background="@drawable/login_btn_bg" android:id="@+id/btn_Login_Login" android:textColor="#ffffff" android:text="LOG IN" android:layout_gravity="bottom|center_horizontal" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginBottom="25dip"></Button> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/tv_Login_ForgotPwd" android:text="Forgot your password?" android:textColor="#000000" android:layout_gravity="bottom|center_horizontal" android:layout_marginBottom="10dip" android:clickable="true"></TextView> </FrameLayout> </FrameLayout>

    Read the article

  • Custom title of PreferenceActivity (problem)

    - by Emerald214
    I have the same problem like this question: Custom title bar in PreferenceActivity ?? After extending PreferenceActivity, I write this code in onCreate(), it just shows a blank grey title. I think it is a bug (because this solution works well with Activity). requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title); super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.main_pref); Edited: window_title.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:background="@color/titleBar" android:layout_height="wrap_content" android:gravity="center_vertical" android:paddingLeft="5dip" android:paddingRight="5dip"> <ImageView android:id="@+id/imageView1" android:src="@drawable/megadict_icon" android:layout_height="35dip" android:layout_width="35dip" android:layout_gravity="center_vertical"> </ImageView> <TextView android:layout_width="wrap_content" android:id="@+id/textView1" android:layout_height="wrap_content" android:textColor="@color/white" android:textSize="16dip" android:layout_weight="1" android:layout_gravity="center_vertical" android:text="@string/appName" android:paddingLeft="5dip" android:paddingRight="5dip"> </TextView> <ProgressBar style="?android:attr/progressBarStyleSmall" android:id="@+id/progressBar" android:layout_width="28dip" android:layout_height="28dip" android:layout_gravity="center_vertical" android:visibility="invisible"> </ProgressBar> </LinearLayout> main_pref.xml <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/mainPrefTitle"> <ListPreference android:entries="@array/languageStrings" android:entryValues="@array/languageValues" android:dialogTitle="@string/languagePrefTitle" android:title="@string/mainPrefTitle" android:key="languagePrefKey"> </ListPreference> </PreferenceScreen>

    Read the article

  • Make buttonsize bigger for tablet? Android, Xml

    - by Cornelia G
    I have a android view with 2 buttons centered. I want to change the button sizes to be bigger when I run the app on a tablet because they look ridiculous small there since it is the same size as for the phones. How can I do this? This is my code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#e9e9e9" android:orientation="vertical" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" > <ImageView android:id="@+id/imageView1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerInParent="true" android_layout_gravity= "center" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:src="@drawable/icon_bakgrund_android"> </ImageView> <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/TableLayout01" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerInParent="true" > <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button1" android:layout_width="260dp" android:layout_height="50dp" android:background="@drawable/nybutton" android:layout_below="@+id/button2" android:text="@string/las_sollefteabladet" android:textColor="#ffffff" android:layout_centerHorizontal="true"/> </TableRow> <TableRow android:id="@+id/TableRow02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="centerCrop"> <Button android:id="@+id/button2" android:layout_width="260dp" android:layout_height="50dp" android:layout_marginTop="10dp" android:background="@drawable/nybutton" android:layout_centerInParent="true" android:text="@string/annonsorer" android:textColor="#ffffff" /> </TableRow> </TableLayout> </RelativeLayout> </RelativeLayout>

    Read the article

  • Why I can't update my UIImageView?

    - by Tattat
    I make my own UIImageView, like this: @interface MyImageView : UIImageView{ } And I have the initWithFrame like this: - (void)initWithFrame{ UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"myImage" ofType:@"png"]]; CGRect cropRect = CGRectMake(175, 0, 175, 175); CGImageRef imageRef = CGImageCreateWithImageInRect([img CGImage], cropRect); self = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 175, 175)]; self.image = [UIImage imageWithCGImage:imageRef]; [self addSubview:imageView]; CGImageRelease(imageRef); } I want to change the image when the user touchesBegin, so I have something like this: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"myImage2" ofType:@"png"]]; CGRect cropRect = CGRectMake(0, 0, 175, 175); CGImageRef imageRef = CGImageCreateWithImageInRect([img CGImage], cropRect); self = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 175, 175)]; [self setImage:[UIImage imageWithCGImage:imageRef]]; CGImageRelease(imageRef); } I find that I can't change the image. So, I add a line [self addSubview:imageView]; in the touchesBegan method, that's work. But I have no idea on why I can't change the image from the touchesBegan, thz.

    Read the article

  • Setting EditText imeOptions to actionNext has no effect

    - by Katedral Pillon
    I have a fairly complex (not really) xml layout file. One of the views is a LinearLayout (v1) with two children: an EditText(v2) and another LinearLayout(v3). The child LinearLayout in turn has an EditText(v4) and an ImageView(v5). For EditText v2 I have imeOptions as android:imeOptions="actionNext" But when I run the app, the keyboard's return does not check to next and I want it to change to next. How do I fix this problem? Also, when user clicks next, I want focus to go to EditText v4. I do I do this? For those who really need to see some code: <LinearLayout android:id="@+id/do_txt_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/col6" android:orientation="vertical" android:visibility="gone" > <EditText android:id="@+id/gm_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp" android:background="@drawable/coldo_text" android:hint="@string/enter_title" android:maxLines="1" android:imeOptions="actionNext" android:padding="5dp" android:textColor="pigc7" android:textSize="ads2" /> <LinearLayout android:layout_width="match_parent" android:layout_height="100dp" android:orientation="horizontal" > <EditText android:id="@+id/rev_text" android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_margin="5dp" android:layout_weight="1" android:background="@drawable/coldo_text" android:hint="@string/enter_msg" android:maxLines="2" android:padding="5dp" android:textColor="pigc7" android:textSize="ads2" /> <ImageView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:background="@drawable/colbtn_r” android:clickable="true" android:onClick=“clickAct” android:paddingLeft="5dp" android:paddingRight="5dp" android:src="@drawable/abcat” /> </LinearLayout> </LinearLayout>

    Read the article

  • how to convert bitmap into byte array in android

    - by satyamurthy
    hi all i am new in android i am implementing image retrieve in sdcard in image convert into bitmap and in bitmap convert in to byte array please forward some solution of this code public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView image = (ImageView) findViewById(R.id.picview); EditText value=(EditText)findViewById(R.id.EditText01); FileInputStream in; BufferedInputStream buf; try { in = new FileInputStream("/sdcard/pictures/1.jpg"); buf = new BufferedInputStream(in,1070); System.out.println("1.................."+buf); byte[] bMapArray= new byte[buf.available()]; buf.read(bMapArray); Bitmap bMap = BitmapFactory.decodeByteArray(bMapArray, 0, bMapArray.length); for (int i = 0; i < bMapArray.length; i++) { System.out.print("bytearray"+bMapArray[i]); } image.setImageBitmap(bMap); value.setText(bMapArray.toString()); if (in != null) { in.close(); } if (buf != null) { buf.close(); } } catch (Exception e) { Log.e("Error reading file", e.toString()); } } } solution is 04-12 16:41:16.168: INFO/System.out(728): 4......................[B@435a2908 this is the result for byte array not display total byte array this array size is 1034 please forward some solution

    Read the article

  • iPhone: Cell imageViews repeating when loaded from url

    - by araid
    I'm developing a demo RSS reader for iPhone. I obviously have a tableview to display the feeds, and then a detailed view. Some of this feeds have a thumbnail that I want to display on cell.imageview of the table, and some don't. The problem is that when scrolling the table, loaded thumbnails start repeating on other cells, and I end up with a thumbnail on every cell. Here's a piece of my code. I may upload screenshots later - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier: @"rssItemCell"]; if(nil == cell){ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"rssItemCell"]autorelease]; } BlogRss *item = [[[self rssParser]rssItems]objectAtIndex:indexPath.row]; cell.textLabel.text = [item title]; cell.detailTextLabel.text = [item description]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; // Thumbnail if exists if(noticia.imagePath != nil){ NSData* imageData; @try { imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:item.imagePath]]; } @catch (NSException * e) { //Some error while downloading data } @finally { item.image = [[UIImage alloc] initWithData:imageData]; [imageData release]; } } if(item.image != nil){ [[cell imageView] setImage:item.image]; } return cell; } Any help will be very appreciated.

    Read the article

  • ArrayAdapter and android:textFilterEnabled

    - by TiGer
    Hi there, I have created a layout which includes a ListView... The data shown within this ListView isn't too complicated, it's mostly an Array which is passed when the extended Activity is started... The rows themselves exist out of an icon and a text, thus an ImageView and a TextView... To fill up the ListView I use an ArrayAdapter simply because an Array is passed containing all the text-items that should be shown.. Now I'd like to actually be able to filter those, thus I found the android:textFilterEnabled paramater to add on the ListView xml declaration... Now a search field is shown nicely but when I enter some letters it won't filter but it will simply delete the whole list... I found out that that's because the textfilter has no idea what it should filter... So now my question is : I know I need to tell the textfilter what it should filter, I also still have my array filled with the text that should get filtered so how do i couple those two ??? I have seen examples extending a CursorAdapter, but again, I don't have a Cursor, I don't want to do calls to a DB I want to re-utilize my Array with data and obviously the ArrayAdapter itself so that the data will be represented decently on screen (i.e with my ImageView and TextView layout)... Thanks in advance for any help/pointers/tips/code...

    Read the article

  • android dynamical binding

    - by yoav.str
    I want to work dynamically therefore I want to bind text views dynamically I think an example would explain me the best assuming I want to bind 7 image views i can do it like this : Country = (EditText)findViewById(R.id.CountryEditText); City = (EditText)findViewById(R.id.CityEditText); LivinigCreture = (EditText)findViewById(R.id.LivingCretureE); Nature =(EditText)findViewById(R.id.NatureEditText); Inanimate = (EditText)findViewById(R.id.InanimateEditText); KnowenPersonality = (EditText)findViewById(R.id.KnowenPersonalityEditText); Occupation = (EditText)findViewById(R.id.OccupationEditText); but lets change 7 with NUMOFFILEDS as a final where i want to do the previous ? myImages = new ImageView [7]; for (int i = 0; i<7;i++,????) myImages[i] = (ImageView)findViewById(R.id.initialImageView01); notice : in my R file the R.id.initialImageView01 - R.id.initialImageView07 are not generate in a cont gap between them therefore I don't know how to make this architecture possible . and if there's a way can someone show me an example how to work dynmiclly (like using jsp on android combined way or something ?) id its possiable to do so constant times is it possible to build an the same xml constant num of times like jsp does thank u pep:)

    Read the article

  • How do You Center a TextView in Layout?

    - by Ken
    I have a complex layout, part of which features a value centered over a label, with + and - buttons on either side of the value. I want the value to center between the buttons, whether it is "1" or "99". It looks fine when it's a 2-digit number like "99", but when it's a single digit the number is left-justified. How do I properly center that value? Here's the portion of my layout that does this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/runway_label" android:layout_centerHorizontal="true" android:orientation="horizontal"> <ImageView android:id="@+id/dec_runway_button" android:src="@drawable/minus_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical"/> <TextView android:id="@+id/runway_value" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:textStyle="bold" android:textSize="40.0sp" android:minWidth="50sp" android:layout_centerInParent="true" android:layout_gravity="center" android:shadowColor="#333333" android:shadowDx="2.0" android:shadowDy="2.0" android:shadowRadius="3.0" /> <ImageView android:id="@+id/inc_runway_button" android:src="@drawable/plus_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical"/> </LinearLayout>

    Read the article

  • Presenting an image cropping interface

    - by wkw
    I'm trying to engineer a UI for cropping images in iphone OS and suspect I'm going about things the hard way. My goal is pretty much what the Tapbots duo have done with Pastebot. In that app, they dim the source image but provide a movable and resizable cropping view and the image you're cropping is in a zoomable scrollview; when you resize or move the underlying image, the cropping view adjusts appropriately. I mocked up a composite image which will give a sense of the design I'm after, along with how I presently have my view hierarchy setup, viewable here The approach I've started with is the following: UIImageView with the image to crop is in a scrollview, a plain UIView with black fill and suitable transparency/alpha setting is added in front of the imageview. I then use a custom UIView which is a sibling to the scrollview at a higher level, which implements the drawRect: method and for the most part calls CGImageCreateWithImageInRect to get the portion of the image's bitmap that matches the position of the cropping view and draws that to the CGContext. in the viewcontroller I'm using the UIScrollViewDelegate methods to track scrolling and passing those changes to the custom cropping UIView so it stays in sync with the scroll contentOffset. That much is finally working. But trying to keep in sync as the scrollview zoomScale changes is when I figured I should ask for help. Looking for suggestions or guidance. My initial approach just seems like more work than is required. Could this be done with a masking layer in the ImageView? And if so, how would I setup the tracking for moving and resizing the cropping rect? My experience working with layers is non-nil, but very limited thus far.

    Read the article

  • Memory leak in Apples 'Scrolling' sample code

    - by John
    Hi All, I'm using code based on Apple's "Scrolling" sample code - here's where I have a problem: // load all the images from our bundle and add them to the scroll view NSUInteger i; for (i = 1; i <= jNumImages; i++) { NSString *imageName = [NSString stringWithFormat:@"page%d.png", i]; UIImage *image = [UIImage imageNamed:imageName]; UIImageView *imageView2 = [[UIImageView alloc] initWithImage:image]; The UIImageView causes a leak - it doesn't seem to be releasing (though I do state [imageView2 release]; after adding the imageView as a subView to scrollView2 I have say 15 chapters of a book each held in a nav bar, each containing a scroll view with one chapters worth of these image views (each image is a page). When I get to around the second last chapter the app crashes due to the memory leaks... really annoying! I think it might be because imageView's been alloc'd twice (in alloc and in addSubView) but i'm not sure.... tried releasing twice but it didn't seem to help. any pointers? Thanks in advance ^.^

    Read the article

  • Android ViewFlipper is out of control

    - by Doug Miller
    I have an app that uses a ViewFlipper to display some text and images. I have the flipper's flipinterval set to 10 seconds, but also want to allow the user to click a button that will advance the flipper. The code blow works great on 2.2, the view is changed every 10 seconds and if I click flip_button the view is changed and the auto flip steps back in 10 seconds later. The 1.5 and 1.6 versions will remember the manual advance and it will happen every time in the rotation. What am I missing? private void initFlipButton(){ final ImageView flip_button = (ImageView) findViewById(R.id.flip_button); info_button.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { flipper.stopFlipping(); flipper.showNext(); flipper.startFlipping(); } }); } private void initFlipper(){ flipper = (ViewFlipper) findViewById(R.id.flip_dog); flipper.setFlipInterval(10000); flipper.setInAnimation(inFromRightAnimation()); flipper.setOutAnimation(outToLeftAnimation()); flipper.startFlipping(); }

    Read the article

  • how to changed editext values from first to last in customise listview in android

    - by prakash
    i am getting menunames from database then append to the custom listview edittext . now i am changing some values in edittext . i want all values with changed values of edittext into array Example :x,y,z menunames comes from database i append editext(Custom listview) now i am changed y to b now i want x,b,z in arraylist i try this code(Base adapter class) public View getView(int position, View convertView, ViewGroup parent) { final ViewHolder holder; if (convertView == null) { holder = new ViewHolder(); convertView = inflater.inflate(R.layout.editmainmenulist, null); holder.caption = (EditText) convertView .findViewById(R.id.editmaimenu); holder.caption1=(ImageView) convertView.findViewById(R.id.menuimage); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } //Fill EditText with the value you have in data source holder.caption.setText(itemnames[position]); holder.caption.setId(position); holder.caption1.setImageBitmap(bmps[position]); arr.add(holder.caption.getText().toString());//here i get menunames data only not changed edittext values return convertView; } } class ViewHolder { EditText caption; ImageView caption1; } class ListItem { String caption; } please help me

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >