imageview

Add shadows at the bottom of image

我怕爱的太早我们不能终老 提交于 2021-02-07 07:22:15
问题 How can I add a shadow over the image (right at the bottom) in order to have the title to be clearly visible. See the image below. 回答1: I wrote an application, which has the same effect. What I did is, I created a FrameLayout which has the ImageView and another View which has the same height of the ImageView. Then I add a transparent gradient background to the View . Example: Layout file: <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android

Creating an Image view of given shape in android

时间秒杀一切 提交于 2021-02-05 06:41:06
问题 I need to create an imageview of this particular shape in Android. If cropping an image in this shape is possible, then also its fine. Please help me out with it? 回答1: This will be the complete set <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitXY" android:src="@drawable/gohan" /> <ImageView android:layout_width="match

How to check which image is linked to ImageView in android?

牧云@^-^@ 提交于 2021-02-05 06:18:05
问题 Well i have one button and one ImageView in my app. What i am trying to do is when i pressing on the button then the image at the ImageView will change. All i have are two pics file. What i am trying to do is - if the first pic is linked to the ImageView than change it to pic2 by clicking on the button, and if pic2 is linked than a click on the button will change it back to the first pic file. here's the onClick method i tried to use: public void onClick(View v) { ImageView ib1 = (ImageView

Adding a Simple Button in java, but java is not allowing me to

我怕爱的太早我们不能终老 提交于 2021-02-04 18:08:30
问题 Ok so from my stand point my code is pretty decent enough to get a passing grade but I am having trouble adding a simple refresh/shuffle button. NOT USING the aids of JOptionPane. Eclipse doesnt seem to recognize that I have created the button which doesnt make sense at all for me because its telling me something about a Node which the Button is in fact a node and it is created. But when I go into another class and add another button with the 3 line example it simply works. But when I move it

Found Drawable, Required 'int'. I am trying to load image in gravityView by Glide library

房东的猫 提交于 2021-01-29 14:58:56
问题 I am trying to load images from url with the help of glide library in gravityView. I searched many solutions and came up with this solution, but this code is giving me the error - Found Drawable, Required 'int'. public class gravity_view extends AppCompatActivity { public String imgurl; ImageView img; GravityView gravityView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gravity_view); img = findViewById(R.id.bg); <-

Display image in android with spaces in filename from online

北城余情 提交于 2021-01-28 23:17:44
问题 I need to display an image in my android application. The problem is I want to get this image from somewhere online. The URL is like: http://www.mydomain.com/hello world image.png As you see the image name containing some spaces in it. Every time I execute my code this will show me exception of FileNotFound. and nothing happens. Following is my code String imagePathCon = "hello world image.png"; String imagePath = "http://www.mydomain.com/" + imagePathCon; try { URL url; url = new URL

Extending ImageView causes memory leak

五迷三道 提交于 2021-01-27 20:20:16
问题 Good day I'm extending the ImageView class because I need it to be a square, the problem is that it seems to be causing a memory leak, because if I use the not extended ImageView class there is no output in MAT. This is the extended version, as you can see is very simple: public class SquareImageView extends ImageView { public SquareImageView(Context context) { super(context); } public SquareImageView(Context context, AttributeSet attrs) { super(context, attrs); } public SquareImageView

how to make image view with three corner and shadow

我的未来我决定 提交于 2021-01-27 14:08:42
问题 How to make an image with only three corners like this I tried using frame layout the insert image view and make it's resource with original image the add another image view with src of border that has 3 corner bu it doesn't work 回答1: With the Material Components library you can use the MaterialShapeDrawable . Just use something like: <com.google.android.material.imageview.ShapeableImageView app:shapeAppearanceOverlay="@style/onlyonecorner" app:srcCompat="@drawable/xxx" ../> with: <style name

how to make image view with three corner and shadow

烂漫一生 提交于 2021-01-27 14:03:18
问题 How to make an image with only three corners like this I tried using frame layout the insert image view and make it's resource with original image the add another image view with src of border that has 3 corner bu it doesn't work 回答1: With the Material Components library you can use the MaterialShapeDrawable . Just use something like: <com.google.android.material.imageview.ShapeableImageView app:shapeAppearanceOverlay="@style/onlyonecorner" app:srcCompat="@drawable/xxx" ../> with: <style name

JavaFX Image Loading in Background and Threads

安稳与你 提交于 2021-01-27 06:11:32
问题 I thought this would be a simple question but I am having trouble finding an answer. I have a single ImageView object associated with a JavaFX Scene object and I want to load large images in from disk and display them in sequence one after another using the ImageView. I have been trying to find a good way to repeatedly check the Image object and when it is done loading in the background set it to the ImageView and then start loading a new Image object. The code I have come up with (below)