2016-05-12 4 views

答えて

1

は、このビューを使用することができます。下のテキスト、内側のアイコン、クリック時に実行するアクションなどを設定することができます。詳細はドキュメントを参照してください。

<android.support.wearable.view.ActionPage 
    android:id="@+id/action_page" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:maxLines="1" 
    android:textColor="@color/st_grey" /> 

IはGridViewPagerでそれを使用する: ここ例であり、それは断片でした。

public View onCreateView(LayoutInflater inflater, ViewGroup container, 
         Bundle savedInstanceState) { 
    View view = inflater.inflate(R.layout.fragment_action, container, false); 
    ActionPage actionPage = (ActionPage) view.findViewById(R.id.action_page); 
    actionPage.setText(actionText); 
    actionPage.setImageResource(iconResId); 
    actionPage.setOnClickListener(onClickListener); 

    return view; 
} 
関連する問題