2016-08-15 2 views
1

Google Play와 같은 imageview/imagebutton에 대한 힌트를 만들려면 어떻게해야합니까?
Android imageview 긴 프레스 힌트

enter image description here

우리가 검색 아이콘에 긴 클릭을 검색 아이콘 아래에 축배를 보여줍니다

,

+0

이것은 당신이 일할 필요가있는 것이 아니라, 당신이 넣을 때 당신에게 제안을 자동적으로 보여줄 것입니다. 도구 모음의 모든 메뉴 항목. 메뉴 항목 태그에이 행을 추가해야합니다. 'android : title = "Google Play 검색" –

+0

@KrishnaJ 답을 확인하십시오. –

답변

1

당신은 툴바 메뉴 및 메뉴 파일을 사용할 수있는 조언을 주시기 바랍니다 이미지 아래 참조하십시오 android:title="Search Google Play"이 속성 . 당신은이 같은 도구 모음 및 메뉴 배치 할 수 있습니다

<menu xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    tools:context="com.example.drawer.EditTransaction" > 

<item 
    android:id="@+id/action_delete" 
    android:orderInCategory="100" 
    android:title="Delete" 
    android:icon="@drawable/ic_action_delete" 
    app:showAsAction="always"/> 

</menu> 

: 예를 들어

해당 메뉴를이의 클릭 이벤트의

toolbar = (Toolbar) findViewById(R.id.toolbar); 
    setSupportActionBar(toolbar); 
    this.toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white100); 
    getSupportActionBar().setTitle("Edit Transaction"); 

및 작업을 수행합니다

@Override 
public boolean onCreateOptionsMenu(Menu menu) { 
    // Inflate the menu; this adds items to the action bar if it is present. 
    getMenuInflater().inflate(R.menu.edit_transaction, menu); 
    return true; 
} 


@Override 
public boolean onOptionsItemSelected(MenuItem item) { 
    switch (item.getItemId()) { 
    case R.id.action_delete: 
     exitConfirmDialog(); 
     break; 
    default: 
     break; 
    } 
    return super.onOptionsItemSelected(item); 
} 
+0

감사합니다. 어떻게 툴바 메뉴를 구현할 수 있습니까? 액션 바가없는 툴바를 사용하고 있으며, NoActionbar 테마를 사용할 때 툴바를 사용할 수 없다는 것을 알고 있습니다. – Ali