imagebutton

how to know which image button I click in datalist

独自空忆成欢 提交于 2019-12-02 09:48:16
I want to change imageurl which image button I click in datalist.So I must get a diffence propertie of imagebutton in datalist.My code is below; <asp:DataList ID="datalistcevaplar" runat="server" Width="740px" OnItemCommand="datalistcevaplar_ItemCommand" > <ItemTemplate> <div class="divcvponay"> <asp:ImageButton ID="imgbtncevaponayla" runat="server" OnCommand="tiklanan" ImageUrl="~/resimler/cevaponaybeyaz.jpg"/> </div> </ItemTemplate> </asp:DataList> and my cs.codes; protected void datalistcevaplar_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName=="tiklanan") { } }

Rows don't render properly in Android Layout. Buttons seem to be the problem

∥☆過路亽.° 提交于 2019-12-02 09:35:44
I am new to Android Development and I am having trouble with my XML Layout... when I inly have rows with text and edittext the layout stays ok, but once I put the row with the buttons the lower rows just disappear below the screen and the rows render way apart from each other... what am I doing wrong? The iPhone version of my app shows the layout I am trying to achieve... http://itunes.apple.com/br/app/my-food-calc/id385519343?mt=8 Thank You, very much! <ImageView android:id="@+id/imageView1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:src="@drawable

Imagebutton with sound is not working

时光总嘲笑我的痴心妄想 提交于 2019-12-02 09:28:48
i made a program in android studio which has 10 imagebutton, each imagebutton when clicked will produce a sound. However, when i run them on emulator only first 7 imagebutton will produce a sound (don't care what order the button i clicked on). Im new to this, help me, This is my code: public class playtimang extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_playtimang); final MediaPlayer satukecik = MediaPlayer.create(this, R.raw.one_kecik); final MediaPlayer satubesar = MediaPlayer

Problem with Image Button visibility! Android

心不动则不痛 提交于 2019-12-02 07:10:39
I have an Image button. I made it invisible. But the onClick event is not getting triggered which makes the button visible. The button should initially be visible for 5seconds, become invisible and then visible again if I click there. private ImageButton nextbutton; @Override protected void onCreate( Bundle savedInstanceState ) { super.onCreate( savedInstanceState ); setContentView( R.layout.first ); nextbutton = ((ImageButton)findViewById( R.id.NextButton )); nextbutton.setVisibility(View.INVISIBLE); nextbutton.setOnClickListener( new OnClickListener() { @Override public void onClick( View v

Android ImageButton

我怕爱的太早我们不能终老 提交于 2019-12-02 03:27:22
public class ImageButton extends ImageView java.lang.Object ↳ android.view.View ↳ android.widget.ImageView ↳ android.widget.ImageButton 直接子类 ZoomButton ImageButton是上面带有图片的Button,与Button只是类似,按钮表面上的图像的定义是在xml文件中通过android:src或者是在java代码中通过imagebutton组件对象调用setImageResource(int a)方法来定义的。 在xml中实现: <?xml version="1.0" encoding="utf-8"?> <ImageButton android:id="@+id/login_btn_id" android:layout_height="wrap_content" android:src="@drawable/button_2" //不是系统图片 或者 Android:src="@android:drawable/sym_call_incoming" //系统自带的图片 android:layout_margin="5px" /> 在代码中实现: //drawable下的图片 m_ImageButton

ImageButton elevation issue

落花浮王杯 提交于 2019-12-02 00:04:02
问题 Good afternoon, I am trying to create en ImageButton with a shadow. To do that : <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:padding="5sp"> <ImageButton android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/circle_shape_little" android:src="@drawable/ic_keyboard_arrow_right_black_24dp" android:elevation="3sp"/> </LinearLayout> But here is the result : As

selected Image button changes its position in recyclerView when scrolling

萝らか妹 提交于 2019-12-01 23:22:58
i have a recyclerview in my MainActivity and i'm showing no of items in list manner through RecyclerView.Adapter . here is my recyclerview_list_items.xml file, <?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="wrap_content" android:orientation="vertical" android:padding="10dp"> <ImageView android:id="@+id/person_photo" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:scaleType=

ImageButton elevation issue

空扰寡人 提交于 2019-12-01 21:32:06
Good afternoon, I am trying to create en ImageButton with a shadow. To do that : <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:padding="5sp"> <ImageButton android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/circle_shape_little" android:src="@drawable/ic_keyboard_arrow_right_black_24dp" android:elevation="3sp"/> </LinearLayout> But here is the result : As you can see, the borders are "cut", and I do not know why. Does anyone can help me ? Thank you. Add a

How to make ImageButtons bounds wrap around the image?

雨燕双飞 提交于 2019-12-01 20:23:46
I'm making a GUI for an android app, this GUI contains a four direction ImageButtons (look at the following image): but when trying to make that always fails because a square reserved for each image, and that's what i reached : and that's my XML code : <LinearLayout android:id="@+id/circle" android:layout_weight="4" android:orientation="vertical" android:layout_marginTop="5dp" android:layout_width="wrap_content" android:layout_height="wrap_content" > <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation=

ImageButton does not display a particular drawable

蓝咒 提交于 2019-12-01 15:33:10
This is rather a funny problem I have ever come across, I have a table layout with 9 image buttons, 3 per row. Every ImageButton has a different image associated with it. I have set the background of the image button to transparent (#00000000). Now here is where the funny stuff happens, One of the images doesn't show up on the emulator (Gingerbread) as well as a device running Froyo. The layout editor shows all the images in place. Here are some more stuff: I used a RelativeLayout instead of a TableLayout , the same issue persists. I changed the position of the image (used it on different